void sort(unsigned *a, int n){
#define N 100000000
#define D 65536
#define D1 65535
#define cal(w,w2,tw,op) \
p=w2-1;\
for(i=0;i<D;++i)rs[i]=p,p+=tw[i];\
for(i=0;i<100000000;i+=16){\
p=w+i;\
*++rs[p[0]op]=p[0],\
*++rs[p[1]op]=p[1],\
*++rs[p[2]op]=p[2],\
*++rs[p[3]op]=p[3],\
*++rs[p[4]op]=p[4],\
*++rs[p[5]op]=p[5],\
*++rs[p[6]op]=p[6],\
*++rs[p[7]op]=p[7];\
*++rs[p[0]op]=p[8],\
*++rs[p[1]op]=p[9],\
*++rs[p[2]op]=p[10],\
*++rs[p[3]op]=p[11],\
*++rs[p[4]op]=p[12],\
*++rs[p[5]op]=p[13],\
*++rs[p[6]op]=p[14],\
*++rs[p[7]op]=p[15];\
}
unsigned b[N],*rs[D],t0[D],t1[D],t2[D],t3[D],t4[D],t5[D],t6[D],t7[D];
unsigned*p,i,x;
for(i=0;i<D;++i){
t0[i]=0;
t1[i]=0;
t2[i]=0;
t3[i]=0;
t4[i]=0;
t5[i]=0;
t6[i]=0;
t7[i]=0;
}
for(i=0;i<N;){
#define A x=a[i],++t0[x&D1],++t1[x>>8&D1],++t2[x>>16&D1],++t3[x>>24&D1],++t4[x>>32&D1],++t5[x>>40&D1],++t6[x>>44&D1],++t3[x>>48],++i;
A A A A A A A A
#undef A
}
cal(a,b,t0,&D1);
cal(b,a,t1,>>8&D1);
cal(a,b,t2,>>16&D1);
cal(b,a,t3,>>24&D1);
cal(a,b,t4,>>32&D1);
cal(b,a,t5,>>40&D1);
cal(a,b,t6,>>44&D1);
cal(b,a,t7,>>48);
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 1.822 s | 765 MB + 460 KB | Runtime Error | Score: 0 | 显示更多 |