unsigned b[100000000],*rs[0x100],t0[0x100],t1[0x100],t2[0x100],t3[0x100];
void sort(unsigned *a, int n){
#define cal(w,w2,tw,op)\
p=w2-1;\
for(i=0;i<0x100;++i)rs[i]=p,p+=tw[i];\
for(i=0;i<100000000;i+=8){\
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];\
}
register unsigned*p,i,x;
for(i=0;i<100000000;){
#define A x=a[i];++t0[x&0xFF];++t1[x>>8&0xFF];++t2[x>>16&0xFF];++t3[x>>24];++i;
A A A A
}
cal(a,b,t0,&0xFF);
cal(b,a,t1,>>8&0xFF);
cal(a,b,t2,>>16&0xFF);
cal(b,a,t3,>>24);
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 786.546 ms | 762 MB + 980 KB | Accepted | Score: 100 | 显示更多 |