提交记录 4558
提交时间 |
评测时间 |
2018-07-25 14:08:48 |
2020-07-31 23:07:24 |
#include <cstdlib>
#include <cstdio>
unsigned cnt1[256], cnt2[256], cnt3[256], cnt4[256], b[100000008], a[100000008];
void sort(unsigned *a, int n) {
for (register int i = 0; i < n; i++) {
cnt1[(a[i] ) & 255]++;
cnt2[(a[i] >> 8 ) & 255]++;
cnt3[(a[i] >> 16) & 255]++;
cnt4[(a[i] >> 24) & 255]++;
}
for (register int i = 1; i < 256; i++) {
cnt1[i] += cnt1[i-1];
cnt2[i] += cnt2[i-1];
cnt3[i] += cnt3[i-1];
cnt4[i] += cnt4[i-1];
}
for (register int i = n-1; ~i; i--) b[--cnt1[(a[i] ) & 255]] = a[i];
for (register int i = n-1; ~i; i--) a[--cnt2[(b[i] >> 8 ) & 255]] = b[i];
for (register int i = n-1; ~i; i--) b[--cnt3[(a[i] >> 16) & 255]] = a[i];
for (register int i = n-1; ~i; i--) a[--cnt4[(b[i] >> 24) & 255]] = b[i];
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 820.572 ms | 762 MB + 980 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-11-24 00:05:37 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠