提交记录 20629


用户 题目 状态 得分 用时 内存 语言 代码长度
platelet 1001. 测测你的排序 Wrong Answer 0 82.757 ms 98244 KB C++17 730 B
提交时间 评测时间
2023-11-29 20:02:07 2023-11-29 20:02:12
#include <bits/stdc++.h>

using namespace std;

const int n = 1e7;

template <class T>
void F(uint* a, uint* b, T lambda) {
    uint *p[256];
    for (int i = 0; i < 256; i++) p[i] = b + n / 256 * i * 2;
    for (int i = 0; i < n; i++) *p[lambda(a[i])]++ = a[i];
    auto ptr = a;
    for (int k = 0; k < 256; k++) {
        auto len = p[k] - (b + n / 256 * k * 2);
        memcpy(ptr, b + n / 256 * k * 2, len * sizeof(uint));
        ptr += len;
    }
}

void sort(uint* a, int __n) {
    uint* b = (uint*)malloc(n * sizeof(uint) * 2);
    F(a, b, [](uint x) { return x & 255; });
    F(a, b, [](uint x) { return x >> 8 & 255; });
    F(a, b, [](uint x) { return x >> 16 & 255; });
    F(a, b, [](uint x) { return x >> 24; });
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #182.757 ms95 MB + 964 KBWrong AnswerScore: 0


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