提交记录 3281
提交时间 |
评测时间 |
2018-07-11 12:07:01 |
2020-07-31 21:15:00 |
const int bucket = 256;
const int maxn = 100000005;
unsigned cnt[bucket];
void sort(unsigned *a, int n) {
unsigned *b = new unsigned[maxn], *tmp;
for (int move = 0; move < 32; move += 8) {
//memset(cnt, 0, sizeof cnt);
for (int j = 0; j < bucket; ++j) cnt[j] = 0;
for (int j = 0; j < n; ++j) ++cnt[(a[j] >> move) & 0xffu];
for (int j = 1; j < bucket; ++j) cnt[j] += cnt[j - 1];
for (int j = n - 1; ~j; --j) b[--cnt[(a[j] >> move) & 0xffu]] = a[j];
//std::swap(a, b);
tmp = a, a = b, b = tmp;
}
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 936.963 ms | 762 MB + 984 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-11-23 23:53:49 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠