提交记录 9455


用户 题目 状态 得分 用时 内存 语言 代码长度
Izumi_Sagiri 1001. 测测你的排序 Wrong Answer 0 854.728 ms 781264 KB C++ 1.30 KB
提交时间 评测时间
2019-05-11 14:55:16 2020-08-01 01:38:27
unsigned tmp[100000001],cnt1[257],cnt2[257],cnt3[257],cnt4[257];
void sort(unsigned *a, int n) {
    register unsigned *ae = a + n, *tmpe = tmp + n, *as = a - 1, *tmps = tmp - 1;
    register unsigned *cnte1 = cnt1 + 257, *cnte2 = cnt2 + 257, *cnte3 = cnt3 + 257, *cnte4 = cnt4 + 257;

    for(register unsigned *i = a; i != ae; ++i)
        ++cnt1[*i & 0xff];
    for(register unsigned *i = cnt1 + 1; i != cnte1; ++i)
        *i += *(i - 1);
    for(register unsigned *i = ae - 1; i != as; --i)
        tmp[cnt1[*i & 0xff]--] = *i;

    for(register unsigned *i = tmp; i != tmpe; ++i)
        ++cnt2[(*i >> 8) & 0xff];
    for(register unsigned *i = cnt2 + 1; i != cnte2; ++i)
        *i += *(i - 1);
    for(register unsigned *i = tmpe - 1; i != tmps; --i)
        a[cnt2[(*i >> 8) & 0xff]--] = *i;

    for(register unsigned *i = a; i != ae; ++i)
        ++cnt3[(*i >> 16) & 0xff];
    for(register unsigned *i = cnt3 + 1; i != cnte3; ++i)
        *i += *(i - 1);
    for(register unsigned *i = ae - 1; i != as; --i)
        tmp[cnt3[(*i >> 16) & 0xff]--] = *i;

    for(register unsigned *i = tmp; i != tmpe; ++i)
        ++cnt4[(*i >> 24) & 0xff];
    for(register unsigned *i = cnt4 + 1; i != cnte4; ++i)
        *i += *(i - 1);
    for(register unsigned *i = tmpe - 1; i != tmps; --i)
        a[cnt4[(*i >> 24) & 0xff]--] = *i;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1854.728 ms762 MB + 976 KBWrong AnswerScore: 0


Judge Duck Online | 评测鸭在线
Server Time: 2026-04-04 06:45:02 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠