提交记录 936


用户 题目 状态 得分 用时 内存 语言 代码长度
orbitingfIea 1001. 测测你的排序 Accepted 100 797.879 ms 781268 KB C 828 B
提交时间 评测时间
2018-06-20 17:49:15 2020-07-31 20:44:38


unsigned b[100000000], c0[256], c1[256], c2[256], c3[256];
unsigned *pos[256];

#define gao(cnt,op) \
		int sum=-1;\
		for (i=0;i<256;++i) pos[i]=B+sum, sum+=cnt[i];\
		unsigned *now=A;\
		for (i=0;i<n;i+=4,now+=4){\
			*(++pos[A[i] op])=*now;\
			*(++pos[A[i+1] op])=now[1];\
			*(++pos[A[i+2] op])=now[2];\
			*(++pos[A[i+3] op])=now[3];\
		}\
		T=A; A=B; B=T;

void songsongsong(unsigned *a,unsigned n){
	{
		register unsigned i;
		for (i=0;i<n;++i){
			++c0[a[i]&255];
			++c1[a[i]>>8&255];
			++c2[a[i]>>16&255];
			++c3[a[i]>>24&255];
		}
	}
	
	unsigned *A=a, *B=b, *T;
	
	{
		register unsigned i;
		gao(c0,&255);
	}
	{
		register unsigned i;
		gao(c1,>>8&255);
	}
	{
		register unsigned i;
		gao(c2,>>16&255);
	}
	{
		register unsigned i;
		gao(c3,>>24&255);
	}
}

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

CompilationN/AN/ACompile OKScore: N/A

Testcase #1797.879 ms762 MB + 980 KBAcceptedScore: 100


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