提交记录 1009


用户 题目 状态 得分 用时 内存 语言 代码长度
AwD 1001. 测测你的排序 Accepted 100 824.144 ms 781264 KB C 915 B
提交时间 评测时间
2018-06-20 18:07:29 2020-07-31 20:45:30
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
int c0[300], c1[300], c2[300], c3[300];
unsigned bi[100000005];

void sort(unsigned *a, int n)
{
    unsigned *ai = a;
    for (register int i = 0; i < n; ++ i)
    {
        c0[ai[i] & 255] ++;
        c1[(ai[i] >> 8) & 255] ++;
        c2[(ai[i] >> 16) & 255] ++;
        c3[ai[i] >> 24] ++;
    }
    for (int i = 1; i < 256; ++ i) c0[i] += c0[i - 1];
    for (int i = 1; i < 256; ++ i) c1[i] += c1[i - 1];
    for (int i = 1; i < 256; ++ i) c2[i] += c2[i - 1];
    for (int i = 1; i < 256; ++ i) c3[i] += c3[i - 1];

    for (register int i = n - 1; ~i; -- i) bi[-- c0[ai[i] & 255]] = ai[i];
    for (register int i = n - 1; ~i; -- i) ai[-- c1[(bi[i] >> 8) & 255]] = bi[i];
    for (register int i = n - 1; ~i; -- i) bi[-- c2[(ai[i] >> 16) & 255]] = ai[i];
    for (register int i = n - 1; ~i; -- i) ai[-- c3[bi[i] >> 24]] = bi[i];

}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1824.144 ms762 MB + 976 KBAcceptedScore: 100


Judge Duck Online | 评测鸭在线
Server Time: 2024-11-23 23:41:08 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠