提交记录 19893


用户 题目 状态 得分 用时 内存 语言 代码长度
lotus_f 1001. 测测你的排序 Accepted 100 861.553 ms 781288 KB C++14 744 B
提交时间 评测时间
2023-08-11 17:11:58 2023-08-11 17:12:04
#include<bits/stdc++.h>
void sort(unsigned *a,int n)
{
	unsigned *b=new unsigned[n],*cnt=new unsigned[256];
	memset(cnt,0,1024);
	register int i;
	for(i=0; i<=n-1; ++i) ++cnt[a[i]&255];
	for(i=1; i<256; ++i) cnt[i]+=cnt[i-1];
	for(i=n-1; i>=0; --i) b[--cnt[a[i]&255]]=a[i];
	memset(cnt,0,1024);
	for(i=0; i<=n-1; ++i) ++cnt[b[i]>>8&255];
	for(i=1; i<256; ++i) cnt[i]+=cnt[i-1];
	for(i=n-1; i>=0; --i) a[--cnt[b[i]>>8&255]]=b[i];
	memset(cnt,0,1024);
	for(i=0; i<=n-1; ++i) ++cnt[a[i]>>16&255];
	for(i=1; i<256; ++i) cnt[i]+=cnt[i-1];
	for(i=n-1; i>=0; --i) b[--cnt[a[i]>>16&255]]=a[i];
	memset(cnt,0,1024);
	for(i=0; i<=n-1; ++i) ++cnt[b[i]>>24&255];
	for(i=1; i<256; ++i) cnt[i]+=cnt[i-1];
	for(i=n-1; i>=0; --i) a[--cnt[b[i]>>24&255]]=b[i];
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1861.553 ms762 MB + 1000 KBAcceptedScore: 100


Judge Duck Online | 评测鸭在线
Server Time: 2025-09-14 09:58:38 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠