提交记录 22050


用户 题目 状态 得分 用时 内存 语言 代码长度
LEE114514 1001. 测测你的排序 Runtime Error 0 1.337 s 781264 KB C++ 619 B
提交时间 评测时间
2024-07-30 19:35:15 2024-07-30 19:35:20
#include <cstdlib>
void sort(unsigned* a,int n) {
	unsigned* b=(unsigned*)malloc(n<<2);
	static unsigned cnt[1<<8];
	int sum=0;	
	unsigned *x=a,*y=b,*tmp;
	for(int i=0;i<32;i+=8){
		sum=0;
		for(int j=0;j<n;++j) cnt[j]=0;
		for(int j=0;j<n;++j) ++cnt[x[j]>>i & 0xff];
		for(int j=0;j<256;++j) sum+=cnt[j],cnt[j]=sum-cnt[j];
		for(int j=0;j<n;++j) y[cnt[x[j]>>i & 0xff]++]=x[j];
		tmp=y;
		y=x;
		x=tmp;
	}
}
//
//#include <cstdio>
//int n;
//const int maxn=1e5+5;
//unsigned a[maxn];
//int main(){
//	scanf("%d",&n);
//	for(int i=0;i<n;++i) scanf("%u",a+i);
//	sort(a,n);
//	for(int i=0;i<n;++i) printf("%u ",a[i]);
//}

CompilationN/AN/ACompile OKScore: N/A

Testcase #11.337 s762 MB + 976 KBRuntime ErrorScore: 0


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