提交记录 1027


用户 题目 状态 得分 用时 内存 语言 代码长度
AwD 1001a. 测测你的排序2 Accepted 100 72.5 us 92 KB C 833 B
提交时间 评测时间
2018-06-20 18:28:14 2020-07-31 20:45:46
int c0[300], c1[300], c2[300], c3[300];
unsigned bi[10005];

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 #172.5 us92 KBAcceptedScore: 100


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