提交记录 15415
| 提交时间 |
评测时间 |
| 2020-12-27 01:35:43 |
2020-12-27 01:35:46 |
typedef unsigned int u32;
u32 b[200000000],cnt0[256],cnt8[256],cnt16[256],cnt24[256];
void sort(u32 *a,int n)
{
for(int i=0;i<n;++i){
++cnt0[a[i]&255];
++cnt8[a[i]>>8&255];
++cnt16[a[i]>>16&255];
++cnt24[a[i]>>24&255];
}
for(int i=1;i<=255;++i){
cnt0[i]+=cnt0[i-1];
cnt8[i]+=cnt8[i-1];
cnt16[i]+=cnt16[i-1];
cnt24[i]+=cnt24[i-1];
}
#define countingSort(a,b,k) {\
int tim=n>>1;\
u32 *now=a+n-1-2;\
while(tim--){\
b[--cnt##k[now[2]>>k&255]]=now[2];\
b[--cnt##k[now[1]>>k&255]]=now[1];\
now-=2;\
}\
if(n&1){\
b[--cnt##k[a[0]>>k&255]]=a[0];\
}\
}
countingSort(a,b,0);
countingSort(b,a,8);
countingSort(a,b,16);
countingSort(b,a,24);
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 1.021 ms | 812 KB | Accepted | Score: 34 | 显示更多 |
| Testcase #2 | 1.114 s | 762 MB + 992 KB | Accepted | Score: 33 | 显示更多 |
| Testcase #3 | 2.228 s | 1525 MB + 928 KB | Accepted | Score: 33 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-03-20 21:02:22 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠