提交记录 20642


用户 题目 状态 得分 用时 内存 语言 代码长度
platelet wc2017b1. 【WC2017】挑战-任务1 Accepted 100 2.162 s 1562532 KB C++17 787 B
提交时间 评测时间
2023-11-30 21:57:26 2023-11-30 21:57:33
#include <bits/stdc++.h>

using namespace std;

void sort(uint* a, int __n) {
    uint n = __n;
    uint buc[4][256] = {};
    uint* b = (uint*)malloc(n * sizeof(uint));
    for (uint 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 (uint k = 0; k < 4; k++) {
        uint32_t offset = 0;
        for (uint i = 0; i < 256; i++)
            swap(buc[k][i], offset), offset += buc[k][i];
    }
    for (uint i = 0; i < n; i++) b[buc[0][a[i] & 255]++] = a[i];
    for (uint i = 0; i < n; i++) a[buc[1][b[i] >> 8 & 255]++] = b[i];
    for (uint i = 0; i < n; i++) b[buc[2][a[i] >> 16 & 255]++] = a[i];
    for (uint i = 0; i < n; i++) a[buc[3][b[i] >> 24 & 255]++] = b[i];
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #11.034 ms812 KBAcceptedScore: 34

Testcase #21.081 s762 MB + 996 KBAcceptedScore: 33

Testcase #32.162 s1525 MB + 932 KBAcceptedScore: 33


Judge Duck Online | 评测鸭在线
Server Time: 2025-09-12 16:56:50 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠