提交记录 31454


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah_dsh_260814 1001b. 测测你的排序3 Accepted 100 43.081 s 1048588 KB C++ 954 B
提交时间 评测时间
2026-08-14 01:57:46 2026-08-14 01:58:49
typedef unsigned int u32;
static u32 tmp[1 << 27];
static u32 cnt[1568];
void sort(unsigned *aa, int n) {
    u32 *a = (u32*)aa;
    int i;
    for (i = 0; i < 1568; i++) cnt[i] = 0;
    for (i = 0; i < n; i++) { u32 x = a[i];
        cnt[0 + (x & 511)]++;
        cnt[512 + ((x>>9) & 511)]++;
        cnt[1024 + ((x>>18) & 511)]++;
        cnt[1536 + ((x>>27) & 31)]++;
    }
    for (i = 1; i < 512; i++) cnt[0+i] += cnt[0+i-1];
    for (i = 1; i < 512; i++) cnt[512+i] += cnt[512+i-1];
    for (i = 1; i < 512; i++) cnt[1024+i] += cnt[1024+i-1];
    for (i = 1; i < 32; i++) cnt[1536+i] += cnt[1536+i-1];
    for (i = n-1; i >= 0; i--) { u32 x = a[i]; tmp[--cnt[0 + (x & 511)]] = x; }
    for (i = n-1; i >= 0; i--) { u32 x = tmp[i]; a[--cnt[512 + ((x>>9) & 511)]] = x; }
    for (i = n-1; i >= 0; i--) { u32 x = a[i]; tmp[--cnt[1024 + ((x>>18) & 511)]] = x; }
    for (i = n-1; i >= 0; i--) { u32 x = tmp[i]; a[--cnt[1536 + ((x>>27) & 31)]] = x; }
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #143.081 s1024 MB + 12 KBAcceptedScore: 100


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