提交记录 21936
用户 |
题目 |
状态 |
得分 |
用时 |
内存 |
语言 |
代码长度 |
houhui |
1001. 测测你的排序 |
Memory Limit Exceeded |
0 |
3.475 s |
1200860 KB |
C++ |
552 B |
提交时间 |
评测时间 |
2024-07-15 19:41:16 |
2024-07-15 19:41:23 |
#include <algorithm>
#include <vector>
using namespace std;
const int B = 1 << 16;
vector<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) {
for(int j = 0; j < cnt[i].size(); ++j)
a[++p] = cnt[i][j];
cnt[i].clear();
}
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) {
for(int j = 0; j < cnt[i].size(); ++j)
a[++p] = cnt[i][j];
cnt[i].clear();
}
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 3.475 s | 1172 MB + 732 KB | Memory Limit Exceeded | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2025-07-09 16:37:52 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠