提交记录 602


用户 题目 状态 得分 用时 内存 语言 代码长度
orbitingfIea 1001a. 测测你的排序2 Accepted 100 75.62 us 88 KB C 981 B
提交时间 评测时间
2018-06-20 14:51:59 2020-07-31 20:40:44
unsigned b[10000], cnt[256];

void songsongsong(unsigned *a,unsigned n){
	unsigned *A=a, *B=b, *T;
	{
		register unsigned i;
		for (i=0;i<256;++i) cnt[i]=0;
		for (i=0;i<n;++i) ++cnt[A[i]&255];
		for (i=1;i<256;++i) cnt[i]+=cnt[i-1];
		for (i=n-1;~i;--i) B[--cnt[A[i]&255]]=A[i];
		T=A; A=B; B=T;
	}
	{
		register unsigned i;
		for (i=0;i<256;++i) cnt[i]=0;
		for (i=0;i<n;++i) ++cnt[A[i]>>8&255];
		for (i=1;i<256;++i) cnt[i]+=cnt[i-1];
		for (i=n-1;~i;--i) B[--cnt[A[i]>>8&255]]=A[i];
		T=A; A=B; B=T;
	}
	{
		register unsigned i;
		for (i=0;i<256;++i) cnt[i]=0;
		for (i=0;i<n;++i) ++cnt[A[i]>>16&255];
		for (i=1;i<256;++i) cnt[i]+=cnt[i-1];
		for (i=n-1;~i;--i) B[--cnt[A[i]>>16&255]]=A[i];
		T=A; A=B; B=T;
	}
	{
		register unsigned i;
		for (i=0;i<256;++i) cnt[i]=0;
		for (i=0;i<n;++i) ++cnt[A[i]>>24&255];
		for (i=1;i<256;++i) cnt[i]+=cnt[i-1];
		for (i=n-1;~i;--i) B[--cnt[A[i]>>24&255]]=A[i];
		T=A; A=B; B=T;
	}
}

void sort(unsigned *a, int n)
{
	songsongsong(a,n);
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #175.62 us88 KBAcceptedScore: 100


Judge Duck Online | 评测鸭在线
Server Time: 2024-12-05 10:25:57 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠