提交记录 21940
用户 |
题目 |
状态 |
得分 |
用时 |
内存 |
语言 |
代码长度 |
houhui |
1001b. 测测你的排序3 |
Memory Limit Exceeded |
0 |
9.691 s |
1144848 KB |
C++ |
506 B |
提交时间 |
评测时间 |
2024-07-15 19:49:46 |
2024-07-15 19:50:00 |
#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(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(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 OK | Score: N/A | 显示更多 |
Testcase #1 | 9.691 s | 1118 MB + 16 KB | Memory Limit Exceeded | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2025-07-16 04:41:34 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠