提交记录 18585


用户 题目 状态 得分 用时 内存 语言 代码长度
Z_301 1001. 测测你的排序 Compile Error 0 0 ns 0 KB C++11 416 B
提交时间 评测时间
2022-10-27 14:40:22 2022-10-27 14:40:23
const int S=1<<8,l=8,N=2e8,S1=S-1;
#define _For(i,l,r) for(int i=l,i##end=r;i<i##end;++i)
inline void __sort(unsigned *a,const int n,int k) {
	k*=l;
	static unsigned h[S],b[N],s,tmp;
	_For(i,0,S)h[i]=0;
	_For(i,0,n)b[i]=a[i],h[(b[i])>>k&S1]++;
	s=*h;*h=0;_For(i,1,S)tmp=h[i],h[i]=s,s+=tmp;
	_For(i,0,n)a[h[b[i]>>k&S1]++]=b[i];
}
inline void sort(unsigned *a,const int n) {
	_For(i,0,32/l)__sort(a,n,i);
}
#undef _For

CompilationN/AN/ACompile ErrorScore: N/A


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