提交记录 9274
提交时间 |
评测时间 |
2019-04-21 20:15:01 |
2020-08-01 01:35:01 |
#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 | 804.907 ms | 762 MB + 976 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-11-23 23:53:05 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠