提交记录 20641
提交时间 |
评测时间 |
2023-11-30 21:47:06 |
2023-11-30 21:47:37 |
#include <bits/stdc++.h>
using namespace std;
void sort(uint* a, int __n) {
size_t n = __n;
uint buc[4][256] = {};
uint* b = (uint*)malloc(n * sizeof(uint));
for (size_t i = 0; i < n; i++) {
buc[0][a[i] & 255]++;
buc[1][a[i] >> 8 & 255]++;
buc[2][a[i] >> 16 & 255]++;
buc[3][a[i] >> 24]++;
}
for (size_t k = 0; k < 4; k++) {
uint32_t offset = 0;
for (size_t i = 0; i < 256; i++)
swap(buc[k][i], offset), offset += buc[k][i];
}
for (size_t i = 0; i < n; i++) b[buc[0][a[i] & 255]++] = a[i];
for (size_t i = 0; i < n; i++) a[buc[1][b[i] >> 8 & 255]++] = b[i];
for (size_t i = 0; i < n; i++) b[buc[2][a[i] >> 16 & 255]++] = a[i];
for (size_t i = 0; i < n; i++) a[buc[3][b[i] >> 24 & 255]++] = b[i];
}
Compilation | N/A | N/A | Compile Error | Score: N/A | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2025-09-12 17:00:11 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠