提交记录 20632


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

using namespace std;

const int n = 1e8;

template <class T>
void F(uint* a, uint* b, T lambda) {
    const double alpha = 1.007;
    uint *p[256], *p0[256];
    for (int i = 0; i < 256; i++)
        p[i] = p0[i] = b + int(n / 256 * i * alpha);
    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] - p0[k];
        memcpy(ptr, p0[k], 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 #1811.248 ms764 MB + 1004 KBWrong AnswerScore: 0


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