提交记录 22048


用户 题目 状态 得分 用时 内存 语言 代码长度
LEE114514 1001. 测测你的排序 Accepted 100 914.206 ms 781272 KB C++ 538 B
提交时间 评测时间
2024-07-30 19:16:34 2024-07-30 19:16:39
void sort(unsigned* a,int n) {
	unsigned *b = new unsigned[n];  // ????
	unsigned *cnt = new unsigned[1 << 8];
	unsigned mask = (1 << 8) - 1;
	unsigned *x = a, *y = b;
	for(int i = 0; i < 32; i += 8) {
    for(int j = 0; j != (1 << 8); ++j) cnt[j] = 0;
    for(int j = 0; j != n; ++j) ++cnt[x[j] >> i & mask];
    for(int sum = 0, j = 0; j != (1 << 8); ++j)
	sum += cnt[j], cnt[j] = sum - cnt[j];
    for(int j = 0; j != n; ++j) y[cnt[x[j] >> i & mask]++] = x[j];
	unsigned *tmp=y;
	y=x;
	x=tmp;
  	}
//  	delete[] cnt;
//  	delete[] b;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1914.206 ms762 MB + 984 KBAcceptedScore: 100


Judge Duck Online | 评测鸭在线
Server Time: 2025-07-15 12:06:07 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠