提交记录 31316
| 提交时间 |
评测时间 |
| 2026-08-14 01:30:49 |
2026-08-14 01:30:58 |
#include <string.h>
typedef unsigned int u32;
static u32 b[200000000];
static u32 cnt[65536];
void sort(unsigned *a, int n) {
u32 *c = cnt;
u32 *tmp = b;
// Pass 1: low 16 bits
memset(c, 0, 65536 * 4);
for (int i = 0; i < n; i++) c[a[i] & 0xFFFF]++;
for (int i = 1; i < 65536; i++) c[i] += c[i-1];
for (int i = n - 1; i >= 0; i--) tmp[--c[a[i] & 0xFFFF]] = a[i];
// Pass 2: high 16 bits
memset(c, 0, 65536 * 4);
for (int i = 0; i < n; i++) c[tmp[i] >> 16]++;
for (int i = 1; i < 65536; i++) c[i] += c[i-1];
for (int i = n - 1; i >= 0; i--) a[--c[tmp[i] >> 16]] = tmp[i];
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 1.537 ms | 1 MB + 40 KB | Accepted | Score: 34 | 显示更多 |
| Testcase #2 | 2.749 s | 763 MB + 220 KB | Accepted | Score: 33 | 显示更多 |
| Testcase #3 | 3 s | 1526 MB + 152 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-09-12 09:22:46 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠