提交记录 9421


用户 题目 状态 得分 用时 内存 语言 代码长度
hengheng 1001. 测测你的排序 Accepted 100 804.795 ms 781264 KB C++ 672 B
提交时间 评测时间
2019-05-07 08:36:51 2020-08-01 01:38:02
#include<cstring>
void sort(unsigned int *a,int n) {
    int num1[256],num2[256],num3[256],num4[256];
    unsigned int b[100000010];
    int p=(1<<8);
    for (int i=0; i<n; i++) {
        num1[a[i]%p]++;
        num2[a[i]/p%p]++;
        num3[a[i]/p/p%p]++;
        num4[a[i]/p/p/p]++;
    }
    for (int i=1; i<p; i++) {
        num1[i]+=num1[i-1];
        num2[i]+=num2[i-1];
        num3[i]+=num3[i-1];
        num4[i]+=num4[i-1];
    }
    for (int i=n-1; i>=0; i--) b[--num1[a[i]%p]]=a[i];
    for (int i=n-1; i>=0; i--) a[--num2[b[i]/p%p]]=b[i];
    for (int i=n-1; i>=0; i--) b[--num3[a[i]/p/p%p]]=a[i];
    for (int i=n-1; i>=0; i--) a[--num4[b[i]/p/p/p]]=b[i];
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1804.795 ms762 MB + 976 KBAcceptedScore: 100


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