提交记录 602
提交时间 |
评测时间 |
2018-06-20 14:51:59 |
2020-07-31 20:40:44 |
unsigned b[10000], cnt[256];
void songsongsong(unsigned *a,unsigned n){
unsigned *A=a, *B=b, *T;
{
register unsigned i;
for (i=0;i<256;++i) cnt[i]=0;
for (i=0;i<n;++i) ++cnt[A[i]&255];
for (i=1;i<256;++i) cnt[i]+=cnt[i-1];
for (i=n-1;~i;--i) B[--cnt[A[i]&255]]=A[i];
T=A; A=B; B=T;
}
{
register unsigned i;
for (i=0;i<256;++i) cnt[i]=0;
for (i=0;i<n;++i) ++cnt[A[i]>>8&255];
for (i=1;i<256;++i) cnt[i]+=cnt[i-1];
for (i=n-1;~i;--i) B[--cnt[A[i]>>8&255]]=A[i];
T=A; A=B; B=T;
}
{
register unsigned i;
for (i=0;i<256;++i) cnt[i]=0;
for (i=0;i<n;++i) ++cnt[A[i]>>16&255];
for (i=1;i<256;++i) cnt[i]+=cnt[i-1];
for (i=n-1;~i;--i) B[--cnt[A[i]>>16&255]]=A[i];
T=A; A=B; B=T;
}
{
register unsigned i;
for (i=0;i<256;++i) cnt[i]=0;
for (i=0;i<n;++i) ++cnt[A[i]>>24&255];
for (i=1;i<256;++i) cnt[i]+=cnt[i-1];
for (i=n-1;~i;--i) B[--cnt[A[i]>>24&255]]=A[i];
T=A; A=B; B=T;
}
}
void sort(unsigned *a, int n)
{
songsongsong(a,n);
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 75.62 us | 88 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-12-05 10:25:57 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠