提交记录 142465
| 提交时间 |
评测时间 |
| 2026-11-07 15:19:58 |
2026-11-07 15:20:02 |
static unsigned b[100000000];
template<int shift>
inline void radix(const unsigned *src, unsigned *dst,
int n, unsigned *cnt) {
for (int i = n - 1; i >= 0; --i) {
unsigned x = src[i];
dst[--cnt[(x >> shift) & 255u]] = x;
}
}
void sort(unsigned *a, int n) {
unsigned cnt[4][256] = {};
for (int i = 0; i < n; ++i) {
unsigned x = a[i];
++cnt[0][x & 255u];
++cnt[1][(x >> 8) & 255u];
++cnt[2][(x >> 16) & 255u];
++cnt[3][x >> 24];
}
for (int k = 0; k < 4; ++k)
for (int j = 1; j < 256; ++j)
cnt[k][j] += cnt[k][j - 1];
radix<0>(a, b, n, cnt[0]);
radix<8>(b, a, n, cnt[1]);
radix<16>(a, b, n, cnt[2]);
radix<24>(b, a, n, cnt[3]);
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 804.357 ms | 762 MB + 976 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-11-26 06:39:20 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠