提交记录 21943
提交时间 |
评测时间 |
2024-07-15 20:47:12 |
2024-07-15 20:47:14 |
#include <algorithm>
const int N = 1e8 + 100, B = 1 << 16;
int n;
int a[N], b[N];
int cnt[B], *p[B];
void sort(unsigned *a, int n) {
for(int i = 1; i <= n; ++i)
++cnt[a[i] & (B - 1)];
for(int i = 0, *pp = b + 1; i < B; ++i)
p[i] = pp, pp += cnt[i], cnt[i] = 0;
for(int i = 1; i <= n; ++i)
*p[a[i] & (B - 1)]++ = a[i];
for(int i = 1; i <= n; ++i)
++cnt[b[i] >> 16];
for(int i = 0, *pp = a + 1; i < B; ++i)
p[i] = pp, pp += cnt[i], cnt[i] = 0;
for(int i = 1; i <= n; ++i)
*p[b[i] >> 16]++ = b[i];
}
Compilation | N/A | N/A | Compile Error | Score: N/A | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2025-07-16 04:36:25 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠