提交记录 31324
| 提交时间 |
评测时间 |
| 2026-08-14 01:33:54 |
2026-08-14 01:34:32 |
#include <string.h>
typedef unsigned int u32;
static u32 b[200000000];
static u32 cnt[1024];
void sort(unsigned *a, int n) {
u32 *c1 = cnt, *c2 = cnt + 256, *c3 = cnt + 512, *c4 = cnt + 768;
u32 *tmp = b;
memset(cnt, 0, sizeof(cnt));
for (int i = 0; i < n; i++) {
u32 x = a[i];
c1[x & 255]++;
c2[(x >> 8) & 255]++;
c3[(x >> 16) & 255]++;
c4[x >> 24]++;
}
for (int i = 1; i < 256; i++) {
c1[i] += c1[i-1];
c2[i] += c2[i-1];
c3[i] += c3[i-1];
c4[i] += c4[i-1];
}
for (int i = n - 1; i >= 0; i--) tmp[--c1[a[i] & 255]] = a[i];
for (int i = n - 1; i >= 0; i--) a[--c2[(tmp[i] >> 8) & 255]] = tmp[i];
for (int i = n - 1; i >= 0; i--) tmp[--c3[(a[i] >> 16) & 255]] = a[i];
for (int i = n - 1; i >= 0; i--) a[--c4[tmp[i] >> 24]] = tmp[i];
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 1.009 ms | 812 KB | Accepted | Score: 34 | 显示更多 |
| Testcase #2 | 1.1 s | 762 MB + 992 KB | Accepted | Score: 33 | 显示更多 |
| Testcase #3 | 2.199 s | 1525 MB + 928 KB | Accepted | Score: 33 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-09-12 09:13:21 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠