提交记录 22051
提交时间 |
评测时间 |
2024-07-30 19:35:40 |
2024-07-30 19:35:45 |
#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;
}
}
//
//#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]);
//}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 911.483 ms | 762 MB + 976 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2025-07-15 10:59:01 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠