提交记录 9386
用户 |
题目 |
状态 |
得分 |
用时 |
内存 |
语言 |
代码长度 |
siyuan |
1001. 测测你的排序 |
Accepted |
100 |
802.575 ms |
781264 KB |
C++11 |
710 B |
提交时间 |
评测时间 |
2019-05-05 20:56:36 |
2020-08-01 01:37:24 |
typedef unsigned int uint;
void sort(uint *a, int n) {
uint t[100000000];
register uint b0[256], b1[256], b2[256], b3[256];
for (register int i = 0; i < n; i++) {
b0[a[i] & 255]++;
b1[(a[i] >> 8) & 255]++;
b2[(a[i] >> 16) & 255]++;
b3[a[i] >> 24]++;
}
for (register int i = 1; i < 256; i++) {
b0[i] += b0[i - 1];
b1[i] += b1[i - 1];
b2[i] += b2[i - 1];
b3[i] += b3[i - 1];
}
for (register int i = n - 1; ~i; i--) {
t[--b0[a[i] & 255]] = a[i];
}
for (register int i = n - 1; ~i; i--) {
a[--b1[(t[i] >> 8) & 255]] = t[i];
}
for (register int i = n - 1; ~i; i--) {
t[--b2[(a[i] >> 16) & 255]] = a[i];
}
for (register int i = n - 1; ~i; i--) {
a[--b3[t[i] >> 24]] = t[i];
}
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 802.575 ms | 762 MB + 976 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-11-24 00:30:09 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠