提交记录 19895


用户 题目 状态 得分 用时 内存 语言 代码长度
lotus_f 1001. 测测你的排序 Accepted 100 864.009 ms 781288 KB C++ 736 B
提交时间 评测时间
2023-08-11 17:13:23 2023-08-11 17:13:28
#include<bits/stdc++.h>
void sort(unsigned *a,int n)
{
	unsigned *b=new unsigned[n];
	int cnt[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 #1864.009 ms762 MB + 1000 KBAcceptedScore: 100


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