提交记录 28057


用户 题目 状态 得分 用时 内存 语言 代码长度
GoatGirl98 wc2017b1. 【WC2017】挑战-任务1 Compile Error 0 0 ns 0 KB C++14 730 B
提交时间 评测时间
2025-04-27 11:38:46 2025-04-27 11:38:48
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)
    {
        u32 offset = 0;
        for (unsigned  = 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 ErrorScore: N/A


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