提交记录 9224
提交时间 |
评测时间 |
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;
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 805.041 ms | 762 MB + 976 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-11-24 00:30:10 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠