提交记录 13331


用户 题目 状态 得分 用时 内存 语言 代码长度
Yukikaze 1001. 测测你的排序 Accepted 100 806.468 ms 781276 KB C++ 591 B
提交时间 评测时间
2020-08-01 10:41:21 2020-08-01 10:41:26
#include <algorithm>

void sort(unsigned *a, int n) {
        unsigned *b=new unsigned int [n];
        int i,cnt0[256]={0},cnt1[256]={0},cnt2[256]={0},cnt3[256]={0}; 
        for(i=0;i<n;i++)
                cnt1[(a[i]>>8)&255]++,cnt2[(a[i]>>16)&255]++,cnt3[(a[i]>>24)&255]++,cnt0[a[i]&255]++;
	for(i=1;i<256;i++) cnt0[i]+=cnt0[i-1],cnt1[i]+=cnt1[i-1],cnt2[i]+=cnt2[i-1],cnt3[i]+=cnt3[i-1];
	for(i=n-1;~i;i--) b[--cnt0[a[i]&255]]=a[i];
	for(i=n-1;~i;i--) a[--cnt1[(b[i]>>8)&255]]=b[i];
	for(i=n-1;~i;i--) b[--cnt2[(a[i]>>16)&255]]=a[i];
	for(i=n-1;~i;i--) a[--cnt3[(b[i]>>24)&255]]=b[i];
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1806.468 ms762 MB + 988 KBAcceptedScore: 100


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