提交记录 15711
提交时间 |
评测时间 |
2021-01-25 12:32:03 |
2021-01-25 12:32:09 |
#include<bits/stdc++.h>
#define REP(i,first,last) for(register int i=(first);i<=(last);++i)
#define CLEAN(a) memset(a,0,sizeof(a))
const int MAXN=1e8+5;
const int W=1e5;
unsigned b[MAXN];
int sum[W+5];
int cnt[W+5];
void sort(unsigned *a,int n)
{
for(register int i(0);i<n;++i)
{
++sum[a[i]%W];
}
REP(i,1,W)
{
sum[i]+=sum[i-1];
cnt[i]=sum[i-1];
}
for(register int i(0);i<n;++i)
{
b[cnt[a[i]%W]++]=a[i];
}
memcpy(a,b,sizeof(b));
CLEAN(sum);
for(register int i(0);i<n;++i)
{
++sum[a[i]/W];
}
cnt[0]=0;
REP(i,1,W)
{
sum[i]+=sum[i-1];
cnt[i]=sum[i-1];
}
for(register int i(0);i<n;++i)
{
b[cnt[a[i]/W]++]=a[i];
}
memcpy(a,b,sizeof(b));
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 2.44 s | 763 MB + 752 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-11-24 00:28:15 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠