提交记录 28076


用户 题目 状态 得分 用时 内存 语言 代码长度
GoatGirl98 wc2017b1. 【WC2017】挑战-任务1 Compile Error 0 0 ns 0 KB C++14 702 B
提交时间 评测时间
2025-04-28 12:02:31 2025-04-28 12:02:33
#include <string.h>
#include <algorithm>
void sort(unsigned *a, int n)
{
    b = new unsigned[n];
    for (int i = 0; i < n; ++i)
    {
        ++buc[0][a[i] & 2047];
        ++buc[1][(a[i] >> 11) & 2047];
        ++buc[2][a[i] >> 22];
    }
    for (unsigned k = 0; k < 3; ++k)
    {
        unsigned offset = 0, lim = (k == 2) ? 1024 : 2048;
        for (unsigned i = 0; i < lim; ++i) 
            std::swap(buc[k][i], offset), offset += buc[k][i];
    }
    for (unsigned i = 0; i < n; ++i) b[buc[0][a[i] & 2047]++] = a[i];
    for (unsigned i = 0; i < n; ++i) a[buc[1][(b[i] >> 11) & 2047]++] = b[i];
    for (unsigned i = 0; i < n; ++i) b[buc[2][a[i] >> 22]++] = a[i];
    memcpy(a, b, n << 2);
}

CompilationN/AN/ACompile ErrorScore: N/A


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