提交记录 22048
提交时间 |
评测时间 |
2024-07-30 19:16:34 |
2024-07-30 19:16:39 |
void sort(unsigned* a,int n) {
unsigned *b = new unsigned[n]; // ????
unsigned *cnt = new unsigned[1 << 8];
unsigned mask = (1 << 8) - 1;
unsigned *x = a, *y = b;
for(int i = 0; i < 32; i += 8) {
for(int j = 0; j != (1 << 8); ++j) cnt[j] = 0;
for(int j = 0; j != n; ++j) ++cnt[x[j] >> i & mask];
for(int sum = 0, j = 0; j != (1 << 8); ++j)
sum += cnt[j], cnt[j] = sum - cnt[j];
for(int j = 0; j != n; ++j) y[cnt[x[j] >> i & mask]++] = x[j];
unsigned *tmp=y;
y=x;
x=tmp;
}
// delete[] cnt;
// delete[] b;
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 914.206 ms | 762 MB + 984 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2025-07-15 12:06:07 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠