提交记录 6834
| 提交时间 |
评测时间 |
| 2018-11-06 18:05:44 |
2020-08-01 00:50:30 |
#include <bits/stdc++.h>
unsigned tmp[100000000];
unsigned cnt[65536];
void sort(unsigned *a, int N)
{
//memset(cnt,0,sizeof(cnt));
for (int i = 0; i < N; i++)
cnt[a[i] & 65535]+=4;
cnt[0] = (unsigned)tmp + cnt[0];
for (int i = 1; i < 65536; i++)
cnt[i] += cnt[i - 1]; //每次相当于移位4
for (int i = N - 1; i >= 0; i--)
*((unsigned*)(cnt[a[i] & 65535]-=4)) = a[i];
memset(cnt,0,sizeof(cnt));
for (int i = 0; i < N; i++)
cnt[tmp[i] >> 16] += 4;
cnt[0] = (unsigned)a + cnt[0];
for (int i = 1; i < 65536; i++)
cnt[i] += cnt[i - 1];
for (int i = N - 1; i >= 0; i--)
*((unsigned*)(cnt[tmp[i] >> 16]-=4)) = tmp[i];
}
| Compilation | N/A | N/A | Compile Error | Score: N/A | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-04-09 10:32:34 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠