提交记录 4900


用户 题目 状态 得分 用时 内存 语言 代码长度
chrogeek 1001. 测测你的排序 Accepted 100 983.222 ms 781272 KB C++ 473 B
提交时间 评测时间
2018-08-03 11:51:48 2020-07-31 23:32:58
// orz wys
#include <string.h>
const int bucket = 256;
const int maxn = 100000005;
unsigned cnt[bucket];
void sort(unsigned *a, int n) {
	unsigned *b = new unsigned[maxn], *tmp;
	for (int move = 0; move < 32; move += 8) {
		memset(cnt, 0, sizeof cnt);
		for (int j = 0; j < n; ++j) ++cnt[(a[j] >> move) & 0xffu];
		for (int j = 1; j < bucket; ++j) cnt[j] += cnt[j - 1];
		for (int j = n - 1; ~j; --j) b[--cnt[(a[j] >> move) & 0xffu]] = a[j];
		tmp = a, a = b, b = tmp;
	}
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1983.222 ms762 MB + 984 KBAcceptedScore: 100


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