#include<cstring>
#define rep(i,a,b) for(signed i(a);i<=b;++i)
#define rep_(i,a,b) for(signed i(a);i^b;++i)
#define req(i,a,b) for(signed i(a);i>=b;--i)
int seed;
int *b,t[257];
#define cns(a,b,opt)\
memset(t,0,sizeof t);\
rep_(i,0,n)++t[a[i]opt];\
rep_(i,1,256)t[i]+=t[i-1];\
req(i,n-1,0)b[--t[a[i]opt]]=a[i];
void sort(unsigned *a, int n)
{
b=new int[n];
cns(a,b,&255); // Chicken number sort
cns(b,a,>>8&255);
cns(a,b,>>16&255);
cns(b,a,>>24&255);
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 1.052 ms | 804 KB | Accepted | Score: 34 | 显示更多 |
Testcase #2 | 1.156 s | 762 MB + 988 KB | Accepted | Score: 33 | 显示更多 |
Testcase #3 | 2.313 s | 1525 MB + 924 KB | Accepted | Score: 33 | 显示更多 |