提交记录 9419


用户 题目 状态 得分 用时 内存 语言 代码长度
chc_1234567890 1001. 测测你的排序 Accepted 100 790.932 ms 781264 KB C++11 1.43 KB
提交时间 评测时间
2019-05-06 21:17:01 2020-08-01 01:37:58
#pragma GCC optimize("-fdelete-null-pointer-checks,inline-functions-called-once,-funsafe-loop-optimizations,-fexpensive-optimizations,-foptimize-sibling-calls,-ftree-switch-conversion,-finline-small-functions,inline-small-functions,-frerun-cse-after-loop,-fhoist-adjacent-loads,-findirect-inlining,-freorder-functions,no-stack-protector,-fpartial-inlining,-fsched-interblock,-fcse-follow-jumps,-fcse-skip-blocks,-falign-functions,-fstrict-overflow,-fstrict-aliasing,-fschedule-insns2,-ftree-tail-merge,inline-functions,-fschedule-insns,-freorder-blocks,-fwhole-program,-funroll-loops,-fthread-jumps,-fcrossjumping,-fcaller-saves,-fdevirtualize,-falign-labels,-falign-loops,-falign-jumps,unroll-loops,-fsched-spec,-ffast-math,Ofast,inline,-fgcse,-fgcse-lm,-fipa-sra,-ftree-pre,-ftree-vrp,-fpeephole2",3)
#pragma GCC target("avx","sse2")
const int maxn=100000003,d=256;
void sort(unsigned *a,int n){
	unsigned p0[d],p1[d],p2[d],p3[d],tp[maxn];
	for(unsigned *i=a,*to=a+n;i!=to;i++)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 #1790.932 ms762 MB + 976 KBAcceptedScore: 100


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