提交记录 31455


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah_dsh_260814 1001b. 测测你的排序3 Accepted 100 12.068 s 1048604 KB C++ 827 B
提交时间 评测时间
2026-08-14 01:57:46 2026-08-14 01:59:04
typedef unsigned int u32;
static u32 tmp[1 << 27];
static u32 cnt[5120];
void sort(unsigned *aa, int n) {
    u32 *a = (u32*)aa;
    int i;
    for (i = 0; i < 5120; i++) cnt[i] = 0;
    for (i = 0; i < n; i++) { u32 x = a[i];
        cnt[0 + (x & 2047)]++;
        cnt[2048 + ((x>>11) & 2047)]++;
        cnt[4096 + ((x>>22) & 1023)]++;
    }
    for (i = 1; i < 2048; i++) cnt[0+i] += cnt[0+i-1];
    for (i = 1; i < 2048; i++) cnt[2048+i] += cnt[2048+i-1];
    for (i = 1; i < 1024; i++) cnt[4096+i] += cnt[4096+i-1];
    for (i = n-1; i >= 0; i--) { u32 x = a[i]; tmp[--cnt[0 + (x & 2047)]] = x; }
    for (i = n-1; i >= 0; i--) { u32 x = tmp[i]; a[--cnt[2048 + ((x>>11) & 2047)]] = x; }
    for (i = n-1; i >= 0; i--) { u32 x = a[i]; tmp[--cnt[4096 + ((x>>22) & 1023)]] = x; }
    for (i = 0; i < n; i++) a[i] = tmp[i];
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #112.068 s1024 MB + 28 KBAcceptedScore: 100


Judge Duck Online | 评测鸭在线
Server Time: 2026-09-12 08:24:55 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠