提交记录 15563


用户 题目 状态 得分 用时 内存 语言 代码长度
wawcac wc2017b1. 【WC2017】挑战-任务1 Accepted 100 2.182 s 1562524 KB C++ 618 B
提交时间 评测时间
2021-01-01 20:38:03 2021-01-01 20:38:07
void sort(unsigned *a,int n)
{
	unsigned *b=new unsigned[n];
	unsigned cnt0[256],cnt8[256],cnt16[256],cnt24[256];
	
	for(int i=0;i<256;i++){
		cnt0[i]=0;
		cnt8[i]=0;
		cnt16[i]=0;
		cnt24[i]=0;
	}
	for(int i=0;i<n;++i){
		++cnt0[a[i]>>0&255];
		++cnt8[a[i]>>8&255];
		++cnt16[a[i]>>16&255];
		++cnt24[a[i]>>24&255];
	}
	for(int i=1;i<=255;++i){
		cnt0[i]+=cnt0[i-1];
		cnt8[i]+=cnt8[i-1];
		cnt16[i]+=cnt16[i-1];
		cnt24[i]+=cnt24[i-1];
	}

#define countingSort(a,b,k) \
for(int i=n-1;~i;--i) b[--cnt##k[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 #1999.23 us804 KBAcceptedScore: 34

Testcase #21.091 s762 MB + 988 KBAcceptedScore: 33

Testcase #32.182 s1525 MB + 924 KBAcceptedScore: 33


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