提交记录 34652
| 提交时间 |
评测时间 |
| 2026-08-14 23:46:40 |
2026-08-14 23:46:45 |
#include <string.h>
typedef unsigned int u32;
static u32 b[200000000];
static u32 cnt[1024];
void sort(unsigned *a, int n) {
u32 *c0 = cnt, *c1 = cnt + 256, *c2 = cnt + 512, *c3 = cnt + 768;
u32 *t = b;
memset(c0, 0, 256*4);
int i = 0;
for (; i + 3 < n; i += 4) {
c0[a[i] & 255]++;
c0[a[i+1] & 255]++;
c0[a[i+2] & 255]++;
c0[a[i+3] & 255]++;
}
for (; i < n; i++) c0[a[i] & 255]++;
u32 s = 0;
for (int j = 0; j < 256; j++) { u32 v = c0[j]; c0[j] = s; s += v; }
memset(c1, 0, 256*4);
for (i = 0; i < n; i++) {
u32 x = a[i];
t[c0[x & 255]++] = x;
c1[(x >> 8) & 255]++;
}
s = 0;
for (int j = 0; j < 256; j++) { u32 v = c1[j]; c1[j] = s; s += v; }
memset(c2, 0, 256*4);
for (i = 0; i < n; i++) {
u32 x = t[i];
a[c1[(x >> 8) & 255]++] = x;
c2[(x >> 16) & 255]++;
}
s = 0;
for (int j = 0; j < 256; j++) { u32 v = c2[j]; c2[j] = s; s += v; }
memset(c3, 0, 256*4);
for (i = 0; i < n; i++) {
u32 x = a[i];
t[c2[(x >> 16) & 255]++] = x;
c3[x >> 24]++;
}
s = 0;
for (int j = 0; j < 256; j++) { u32 v = c3[j]; c3[j] = s; s += v; }
for (i = 0; i < n; i++) {
u32 x = t[i];
a[c3[x >> 24]++] = x;
}
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 1.003 ms | 812 KB | Accepted | Score: 34 | 显示更多 |
| Testcase #2 | 1.059 s | 762 MB + 992 KB | Accepted | Score: 33 | 显示更多 |
| Testcase #3 | 2.12 s | 1525 MB + 928 KB | Accepted | Score: 33 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-09-08 18:42:17 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠