提交记录 9224


用户 题目 状态 得分 用时 内存 语言 代码长度
realSpongeBob 1001. 测测你的排序 Accepted 100 805.041 ms 781264 KB C++ 799 B
提交时间 评测时间
2019-04-20 10:25:35 2020-08-01 01:34:32
#include <algorithm>

const int MAXN = 1e8 + 10;

void sort(unsigned int *a, int n) {
        int bin0[256], bin1[256], bin2[256],bin3[256];
        unsigned int b[MAXN];
	for (int i = 0; i < n; ++i) {
		++bin0[a[i] & 255];
		++bin1[a[i] >> 8 & 255];
		++bin2[a[i] >> 16 & 255];
		++bin3[a[i] >> 24 & 255];
	}

	for (int i = 1; i < 256; ++i) bin0[i] += bin0[i - 1];
	for (int i = 1; i < 256; ++i) bin1[i] += bin1[i - 1];
	for (int i = 1; i < 256; ++i) bin2[i] += bin2[i - 1];
	for (int i = 1; i < 256; ++i) bin3[i] += bin3[i - 1];

	for (int i = n - 1; ~i; --i) b[--bin0[a[i] & 255]] = a[i];
	for (int i = n - 1; ~i; --i) a[--bin1[b[i] >> 8 & 255]] = b[i];
	for (int i = n - 1; ~i; --i) b[--bin2[a[i] >> 16 & 255]] = a[i];
	for (int i = n - 1; ~i; --i) a[--bin3[b[i] >> 24 & 255]] = b[i];
	return;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1805.041 ms762 MB + 976 KBAcceptedScore: 100


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