提交记录 21938
提交时间 |
评测时间 |
2024-07-15 19:47:46 |
2024-07-15 19:47:47 |
#include <algorithm>
#include <queue>
using namespace std;
const int B = 1 << 16;
queue<unsigned> cnt[B];
void sort(unsigned *a, int n) {
--a;
for(int i = 1; i <= n; ++i)
cnt[a[i] & ((1 << 16) - 1)].push_back(a[i]);
for(int i = 0, p = 0; i < (1 << 16); ++i) {
while(cnt[i].size())
a[++p] = cnt[i].front(), cnt[i].pop();
}
for(int i = 1; i <= n; ++i)
cnt[a[i] >> 16].push_back(a[i]);
for(int i = 0, p = 0; i < (1 << 16); ++i) {
while(cnt[i].size())
a[++p] = cnt[i].front(), cnt[i].pop();
}
}
Compilation | N/A | N/A | Compile Error | Score: N/A | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2025-07-16 03:57:38 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠