提交记录 19896
提交时间 |
评测时间 |
2023-08-11 17:14:12 |
2023-08-11 17:14:14 |
#include<stdio.h>
#include<string.h>
void sort(unsigned *a,int n)
{
unsigned *b=new unsigned[n],*cnt=new unsigned[256];
memset(cnt,0,1024);
register int i;
for(i=0; i<=n-1; ++i) ++cnt[a[i]&255];
for(i=1; i<256; ++i) cnt[i]+=cnt[i-1];
for(i=n-1; i>=0; --i) b[--cnt[a[i]&255]]=a[i];
memset(cnt,0,1024);
for(i=0; i<=n-1; ++i) ++cnt[b[i]>>8&255];
for(i=1; i<256; ++i) cnt[i]+=cnt[i-1];
for(i=n-1; i>=0; --i) a[--cnt[b[i]>>8&255]]=b[i];
memset(cnt,0,1024);
for(i=0; i<=n-1; ++i) ++cnt[a[i]>>16&255];
for(i=1; i<256; ++i) cnt[i]+=cnt[i-1];
for(i=n-1; i>=0; --i) b[--cnt[a[i]>>16&255]]=a[i];
memset(cnt,0,1024);
for(i=0; i<=n-1; ++i) ++cnt[b[i]>>24&255];
for(i=1; i<256; ++i) cnt[i]+=cnt[i-1];
for(i=n-1; i>=0; --i) a[--cnt[b[i]>>24&255]]=b[i];
}
Compilation | N/A | N/A | Compile Error | Score: N/A | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2025-09-14 09:55:13 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠