#define fora(i,l,r) for(unsigned *i=l,*to=r;i!=to;i++)
const int maxn=100000003,d=256;
unsigned p0[d],p1[d],p2[d],p3[d],tp[maxn];
void sort(unsigned *a,int n){
fora(i,a,a+n)p0[*i&255]++,p1[(*i>>8)&255]++,p2[(*i>>16)&255]++,p3[(*i>>24)&255]++;
for(unsigned *i0=p0+1,*i1=p1+1,*i2=p2+1,*i3=p3+1,*to0=p0+d;i0!=to0;i0++,i1++,i2++,i3++)
*i0+=*(i0-1),*i1+=*(i1-1),*i2+=*(i2-1),*i3+=*(i3-1);
for(unsigned *i=a+n-1,*to=a-1;i!=to;i--)tp[--p0[*i&255]]=*i;
for(unsigned *i=tp+n-1,*to=tp-1;i!=to;i--)a[--p1[(*i>>8)&255]]=*i;
for(unsigned *i=a+n-1,*to=a-1;i!=to;i--)tp[--p2[(*i>>16)&255]]=*i;
for(unsigned *i=tp+n-1,*to=tp-1;i!=to;i--)a[--p3[(*i>>24)&255]]=*i;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 822.993 ms | 762 MB + 976 KB | Accepted | Score: 100 | 显示更多 |