提交记录 22004


用户 题目 状态 得分 用时 内存 语言 代码长度
cxy_t 1001c. 测测你的排序4 Accepted 100 16.498 s 1048596 KB C++ 533 B
提交时间 评测时间
2024-07-27 11:36:02 2024-07-27 11:36:24
#include <cstring>
typedef unsigned int u32;
int cnt0[256],cnt8[256],cnt16[256],cnt24[256];
#define cs(a,n,d,b) \
    for(int i=0;i<n;i++){\
        cnt##d[(a[i]>>d)&0xff]++;\
    }\
    for(int i=1;i<256;i++){\
        cnt##d[i]+=cnt##d[i-1];\
    }\
    for(int i=n-1;i>=0;i--){\
        b[--cnt##d[(a[i]>>d)&0xff]]=a[i];\
    }\
    memcpy(a,b,n<<2);
void sort(u32* a,int n){
    if (n!=(1<<27)){
        __builtin_unreachable();
    }
    u32 *b=new u32[n];
    cs(a,n,0,b);
    cs(a,n,8,b);
    cs(a,n,16,b);
    cs(a,n,24,b);
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #116.498 s1024 MB + 20 KBAcceptedScore: 100


Judge Duck Online | 评测鸭在线
Server Time: 2024-09-08 09:31:09 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用