提交记录 9685


用户 题目 状态 得分 用时 内存 语言 代码长度
LMOliver 1001a. 测测你的排序2 Accepted 100 71.23 us 92 KB C++ 1016 B
提交时间 评测时间
2019-06-30 00:16:37 2020-08-01 01:45:21
typedef unsigned int UI;
typedef unsigned char UC;
void sort(register UI *a,register int n){
	register UI c0[257]={0};
	register UI c1[257]={0};
	register UI c2[257]={0};
	register UI c3[257]={0};
	// cerr<<"OK"<<endl;
	register UC *p0=((UC*)a)-4;
	register UC *p1=((UC*)a)-3;
	register UC *p2=((UC*)a)-2;
	register UC *p3=((UC*)a)-1;
	// cerr<<"OK"<<endl;
	for(register int _=0;_<n;++_){
		// cerr<<"a["<<_<<"]="<<a[_]<<endl;
		++c0[*(p0+=4)];
		++c1[*(p1+=4)];
		++c2[*(p2+=4)];
		++c3[*(p3+=4)];
		// cerr<<"count "<<_<<" "<<(int)*p0<<" "<<(int)*p1<<" "<<(int)*p2<<" "<<(int)*p3<<endl;
	}
	// cerr<<"OK"<<endl;
	register UI x;
	for(register int i=1;i<256;++i){
		x=i-1;
		c0[i]+=c0[x];
		c1[i]+=c1[x];
		c2[i]+=c2[x];
		c3[i]+=c3[x];
	}
	static UI b[10001];
	for(register int i=n-1;i>=0;--i){x=a[i];b[--c0[x&0xff]]=x;}
	for(register int i=n-1;i>=0;--i){x=b[i];a[--c1[(x>>8)&0xff]]=x;}
	for(register int i=n-1;i>=0;--i){x=a[i];b[--c2[(x>>16)&0xff]]=x;}
	for(register int i=n-1;i>=0;--i){x=b[i];a[--c3[x>>24]]=x;}
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #171.23 us92 KBAcceptedScore: 100


Judge Duck Online | 评测鸭在线
Server Time: 2024-04-26 05:34:14 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用