提交记录 15825


用户 题目 状态 得分 用时 内存 语言 代码长度
_wangXiWen 1001a. 测测你的排序2 Runtime Error 0 87.2 us 88 KB C++ 1.80 KB
提交时间 评测时间
2021-02-07 11:41:31 2021-02-07 11:41:33
#include <algorithm>
int tmp[100000010];
void sort(unsigned *data,int n)
{
	int count[256],radix=1,k;
	for(int j=0;j<256;j++) count[j]=0;
	for(register int j=1;j<=n;++j)
	{
		k=(data[j]/radix)%256;//统计每个桶中的记录数
		count[k]++;
	}
	for(register int j=1;j<256;++j)
	{
		count[j]+=count[j-1];
	}
	for(register int j=n;j>=1;--j)
	{
		k=(data[j]/radix)%256;
		tmp[count[k]]=data[j];
		count[k]--;
	}
	for(register int j=1;j<=n;data[j]=tmp[j],++j);
	radix*=256;
	for(int j=0;j<256;j++) count[j]=0;
	for(register int j=1;j<=n;++j)
	{
		k=(data[j]/radix)%256;//统计每个桶中的记录数
		count[k]++;
	}
	for(register int j=1;j<256;++j)
	{
		count[j]+=count[j-1];
	}
	for(register int j=n;j>=1;--j)
	{
		k=(data[j]/radix)%256;
		tmp[count[k]]=data[j];
		count[k]--;
	}
	for(register int j=1;j<=n;data[j]=tmp[j],++j);
	radix*=256;
	for(int j=0;j<256;j++) count[j]=0;
	for(register int j=1;j<=n;++j)
	{
		k=(data[j]/radix)%256;//统计每个桶中的记录数
		count[k]++;
	}
	for(register int j=1;j<256;++j)
	{
		count[j]+=count[j-1];
	}
	for(register int j=n;j>=1;--j)
	{
		k=(data[j]/radix)%256;
		tmp[count[k]]=data[j];
		count[k]--;
	}
	for(register int j=1;j<=n;data[j]=tmp[j],++j);
	radix*=256;
	for(int j=0;j<256;j++) count[j]=0;
	for(register int j=1;j<=n;++j)
	{
		k=(data[j]/radix)%256;//统计每个桶中的记录数
		count[k]++;
	}
	for(register int j=1;j<256;++j)
	{
		count[j]+=count[j-1];
	}
	for(register int j=n;j>=1;--j)
	{
		k=(data[j]/radix)%256;
		tmp[count[k]]=data[j];
		count[k]--;
	}
	for(register int j=1;j<=n;data[j]=tmp[j],++j);
	radix*=256;
	for(int j=0;j<256;j++) count[j]=0;
	for(register int j=1;j<=n;++j)
	{
		k=(data[j]/radix)%256;//统计每个桶中的记录数
		count[k]++;
	}
	for(register int j=1;j<256;++j)
	{
		count[j]+=count[j-1];
	}
	for(register int j=n;j>=1;--j)
	{
		k=(data[j]/radix)%256;
		tmp[count[k]]=data[j];
		count[k]--;
	}
	for(register int j=1;j<=n;data[j]=tmp[j],++j);
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #187.2 us88 KBRuntime ErrorScore: 0


Judge Duck Online | 评测鸭在线
Server Time: 2026-03-20 05:25:43 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠