提交记录 9383
提交时间 |
评测时间 |
2019-05-05 20:51:48 |
2020-08-01 01:37:19 |
#include <bits/stdc++.h>
const int N = 1e8 + 7, maxv = 1 << 8;
void sort(unsigned int *a, int n) {
unsigned int c1[maxv], c2[maxv], c3[maxv], c4[maxv], b[N];
for (int i = 0; i < n; i++) {
c1[a[i] & (maxv - 1)]++;
c2[(a[i] >> 8) & (maxv - 1)]++;
c3[(a[i] >> 16) & (maxv - 1)]++;
c4[a[i] >> 24]++;
}
for (int i = 1; i < maxv; i++) c1[i] += c1[i - 1], c2[i] += c2[i - 1], c3[i] += c3[i - 1], c4[i] += c4[i - 1];
for (int i = n - 1; i >= 0; i--) b[--c1[a[i] & (maxv - 1)]] = a[i];
for (int i = n - 1; i >= 0; i--) a[--c2[(b[i] >> 8) & (maxv - 1)]] = b[i];
for (int i = n - 1; i >= 0; i--) b[--c3[(a[i] >> 16) & (maxv - 1)]] = a[i];
for (int i = n - 1; i >= 0; i--) a[--c4[b[i] >> 24]] = b[i];
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 802.633 ms | 762 MB + 1000 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-11-24 00:28:01 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠