提交记录 9421
提交时间 |
评测时间 |
2019-05-07 08:36:51 |
2020-08-01 01:38:02 |
#include<cstring>
void sort(unsigned int *a,int n) {
int num1[256],num2[256],num3[256],num4[256];
unsigned int b[100000010];
int p=(1<<8);
for (int i=0; i<n; i++) {
num1[a[i]%p]++;
num2[a[i]/p%p]++;
num3[a[i]/p/p%p]++;
num4[a[i]/p/p/p]++;
}
for (int i=1; i<p; i++) {
num1[i]+=num1[i-1];
num2[i]+=num2[i-1];
num3[i]+=num3[i-1];
num4[i]+=num4[i-1];
}
for (int i=n-1; i>=0; i--) b[--num1[a[i]%p]]=a[i];
for (int i=n-1; i>=0; i--) a[--num2[b[i]/p%p]]=b[i];
for (int i=n-1; i>=0; i--) b[--num3[a[i]/p/p%p]]=a[i];
for (int i=n-1; i>=0; i--) a[--num4[b[i]/p/p/p]]=b[i];
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 804.795 ms | 762 MB + 976 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-11-24 00:14:54 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠