提交记录 166


用户 题目 状态 得分 用时 内存 语言 代码长度
hqztrue 1001. 测测你的排序 Compile Error 0 0 ns 0 KB C 522 B
提交时间 评测时间
2018-06-20 12:41:20 2020-07-31 20:35:42
unsigned B[100000005],s[2047+1];
void radix_sort(unsigned *A,int l,int r){  //a[i]>=0
	//const int base=65535,W=16;
	const int base=2047,W=11;
	//const int base=255,W=8;
	const int T=(32-1)/W+1;
	A+=l-1;r-=l-1;l=1;
	unsigned *a=A,*b=B,x=0;
	for (int i1=1;i1<=T;++i1){
		for (int i=0;i<=base;++i)s[i]=0;
		for (int i=1;i<=r;++i)++s[a[i]>>x&base];
		for (int i=1;i<=base;++i)s[i]+=s[i-1];
		for (int i=r;i>=1;--i)b[s[a[i]>>x&base]--]=a[i];
		unsigned *tmp=a;a=b;b=tmp;
		x+=W;
	}
	if (a!=A)for (int i=1;i<=r;++i)A[i]=a[i];
}

CompilationN/AN/ACompile ErrorScore: N/A


Judge Duck Online | 评测鸭在线
Server Time: 2026-04-30 18:52:31 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠