提交记录 9416


用户 题目 状态 得分 用时 内存 语言 代码长度
chc_1234567890 1001. 测测你的排序 Accepted 100 819.877 ms 781264 KB C++11 656 B
提交时间 评测时间
2019-05-06 21:09:37 2020-08-01 01:37:56
#define fora(i,l,r) for(unsigned *i=l,*to=r;i!=to;i++)
const int maxn=100000000,d=256;
unsigned p0[d],p1[d],p2[d],p3[d],tp[maxn];
void sort(unsigned *a,int n){
	fora(i,a,a+n)p0[*i&255]++,p1[(*i>>8)&255]++,p2[(*i>>16)&255]++,p3[(*i>>24)&255]++;
	for(unsigned *i0=p0+1,*i1=p1+1,*i2=p2+1,*i3=p3+1,*to0=p0+d;i0!=to0;i0++,i1++,i2++,i3++)
		*i0+=*(i0-1),*i1+=*(i1-1),*i2+=*(i2-1),*i3+=*(i3-1);
	for(unsigned *i=a+n-1,*to=a-1;i!=to;i--)tp[--p0[*i&255]]=*i;
	for(unsigned *i=tp+n-1,*to=tp-1;i!=to;i--)a[--p1[(*i>>8)&255]]=*i;
	for(unsigned *i=a+n-1,*to=a-1;i!=to;i--)tp[--p2[(*i>>16)&255]]=*i;
	for(unsigned *i=tp+n-1,*to=tp-1;i!=to;i--)a[--p3[(*i>>24)&255]]=*i;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1819.877 ms762 MB + 976 KBAcceptedScore: 100


Judge Duck Online | 评测鸭在线
Server Time: 2026-04-04 08:14:28 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠