提交记录 15562


用户 题目 状态 得分 用时 内存 语言 代码长度
wawcac wc2017b1. 【WC2017】挑战-任务1 Accepted 100 2.334 s 1562520 KB C++ 374 B
提交时间 评测时间
2021-01-01 19:39:49 2021-01-01 19:39:53
void sort(unsigned *a,int n)
{
	unsigned *b=new unsigned[n];
	unsigned cnt[256];

#define countingSort(a,b,k) \
for(int i=0;i<256;i++) cnt[i]=0;\
for(int i=0;i<n;++i) ++cnt[a[i]>>k&255];\
for(int i=1;i<=255;++i) cnt[i]+=cnt[i-1];\
for(int i=n-1;~i;--i) b[--cnt[a[i]>>k&255]]=a[i];\

	countingSort(a,b,0);
	countingSort(b,a,8);
	countingSort(a,b,16);
	countingSort(b,a,24);
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #11.062 ms800 KBAcceptedScore: 34

Testcase #21.166 s762 MB + 984 KBAcceptedScore: 33

Testcase #32.334 s1525 MB + 920 KBAcceptedScore: 33


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