提交记录 142495


用户 题目 状态 得分 用时 内存 语言 代码长度
bpc363 1001. 测测你的排序 Accepted 100 2.364 s 781516 KB C++ 420 B
提交时间 评测时间
2026-11-10 20:17:06 2026-11-10 20:17:13
#include<algorithm>

constexpr int B=16;
constexpr int msk=(1<<B)-1;
unsigned b[100000000];
int cnt[1<<B];

void sort(unsigned *a, int n) {
    unsigned *b=::b;
    for(int p=0;p<32;p+=B){
        for(int i=0;i<(1<<B);++i)cnt[i]=0;
        for(int i=0;i<n;++i)cnt[a[i]>>p&msk]++;
        for(int i=1;i<(1<<B);++i)cnt[i]+=cnt[i-1];
        for(int i=n-1;~i;--i)b[--cnt[a[i]>>p&msk]]=a[i];
        std::swap(a,b);
    }
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #12.364 s763 MB + 204 KBAcceptedScore: 100


Judge Duck Online | 评测鸭在线
Server Time: 2026-11-12 08:30:21 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠