提交记录 22052
提交时间 |
评测时间 |
2024-07-30 19:36:12 |
2024-07-30 19:36:14 |
#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<256;++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;
}
delete b[];
}
Compilation | N/A | N/A | Compile Error | Score: N/A | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2025-07-15 10:54:27 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠