提交记录 12357


用户 题目 状态 得分 用时 内存 语言 代码长度
Soulist 1001. 测测你的排序 Wrong Answer 0 790.482 ms 762 MB + 1004 KB C++ 835 B
提交时间 评测时间
2020-03-26 21:09:22 2020-03-26 21:09:27
#include <algorithm>
const int M = 500 + 5 ;
const int N = 1e8 + 5 ; 
unsigned cnt1[M], cnt2[M], cnt3[M], cnt4[M], b[N] ;
void sort(unsigned *a, int n) {

    for (register int i = 0; i < n; i++) {
        cnt1[(a[i]) & 255]++;
        cnt2[(a[i] >> 8) & 255]++;
        cnt3[(a[i] >> 16) & 255]++;
        cnt4[(a[i] >> 24) & 255]++;
    }
    for (register int i = 1; i < 256; i++) {
        cnt1[i] += cnt1[i - 1];
        cnt2[i] += cnt2[i - 1];
        cnt3[i] += cnt3[i - 1];
        cnt4[i] += cnt4[i - 1];
    }
    for (register int i = n - 1; ~i; i--) b[--cnt1[(a[i]) & 255]] = a[i];
    for (register int i = n - 1; ~i; i--) a[--cnt2[(b[i] >> 8) & 255]] = b[i];
    for (register int i = n - 1; ~i; i--) b[--cnt3[(a[i] >> 16) & 255]] = a[i];
    for (register int i = n - 1; ~i; i--) a[--cnt4[(b[i] >> 24) & 255]] = b[i];
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1790.482 ms762 MB + 1004 KBWrong AnswerScore: 0


Judge Duck Online | 评测鸭在线
Server Time: 2020-04-06 09:34:35 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用