提交记录 19896


用户 题目 状态 得分 用时 内存 语言 代码长度
lotus_f 1001. 测测你的排序 Compile Error 0 0 ns 0 KB C 757 B
提交时间 评测时间
2023-08-11 17:14:12 2023-08-11 17:14:14
#include<stdio.h>
#include<string.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 ErrorScore: N/A


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