提交记录 30621
| 提交时间 |
评测时间 |
| 2026-08-12 23:40:46 |
2026-08-12 23:40:54 |
typedef unsigned u32;
enum { RAD=2048, MASK=2047 };
static u32 temp[100000000], count[RAD], start[RAD], next[RAD];
static void inplace_pass(u32*a,int n,int shift){
for(int i=0;i<RAD;++i)count[i]=0;
for(int i=0;i<n;++i)++count[(a[i]>>shift)&MASK];
u32 sum=0;
for(int i=0;i<RAD;++i){start[i]=next[i]=sum;sum+=count[i];}
for(int bucket=0;bucket<RAD;++bucket){
u32 end=start[bucket]+count[bucket];
while(next[bucket]<end){
u32 p=next[bucket],v=a[p],b=(v>>shift)&MASK;
if(b== (u32)bucket){++next[bucket];continue;}
u32 q=next[b]++;a[p]=a[q];a[q]=v;
}
}
}
void sort(u32*a,int n){
if(n<=100000000){
u32*src=a,*dst=temp;
for(int shift=0;shift<33;shift+=11){
for(int i=0;i<RAD;++i)count[i]=0;
for(int i=0;i<n;++i)++count[(src[i]>>shift)&MASK];
u32 sum=0;for(int i=0;i<RAD;++i){u32 c=count[i];count[i]=sum;sum+=c;}
for(int i=0;i<n;++i){u32 v=src[i];dst[count[(v>>shift)&MASK]++]=v;}
u32*t=src;src=dst;dst=t;
}
if(src!=a)for(int i=0;i<n;++i)a[i]=src[i];
}else{
inplace_pass(a,n,0);inplace_pass(a,n,11);inplace_pass(a,n,22);
}
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 1.293 ms | 820 KB | Accepted | Score: 34 | 显示更多 |
| Testcase #2 | 1.574 s | 762 MB + 996 KB | Accepted | Score: 33 | 显示更多 |
| Testcase #3 | 3 s | 762 MB + 1012 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-09-12 12:35:17 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠