提交记录 28062


用户 题目 状态 得分 用时 内存 语言 代码长度
GoatGirl98 1001. 测测你的排序 Accepted 100 797.05 ms 781268 KB C++14 757 B
提交时间 评测时间
2025-04-27 11:42:49 2025-04-27 11:42:54
#include <algorithm>
unsigned b[200000000];
unsigned buc[4][256];

void sort(unsigned *a, int n)
{
    for (int i = 0; i < n; ++i)
    {
        ++buc[0][a[i] & 255];
        ++buc[1][(a[i] >> 8) & 255];
        ++buc[2][(a[i] >> 16) & 255];
        ++buc[3][a[i] >> 24];
    }
    for (unsigned k = 0; k < 4; ++k)
    {
        unsigned offset = 0;
        for (unsigned i = 0; i < 256; ++i) 
            std::swap(buc[k][i], offset), offset += buc[k][i];
    }
    for (unsigned i = 0; i < n; ++i) b[buc[0][a[i] & 255]++] = a[i];
    for (unsigned i = 0; i < n; ++i) a[buc[1][b[i] >> 8 & 255]++] = b[i];
    for (unsigned i = 0; i < n; ++i) b[buc[2][a[i] >> 16 & 255]++] = a[i];
    for (unsigned i = 0; i < n; ++i) a[buc[3][b[i] >> 24 & 255]++] = b[i];
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1797.05 ms762 MB + 980 KBAcceptedScore: 100


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