提交记录 27764
提交时间 |
评测时间 |
2025-01-20 00:13:53 |
2025-01-20 00:13:55 |
#include <cstddef> // for size_t
#include <algorithm> // for std::swap
void partition(unsigned *a, size_t start, size_t length, int bit) {
size_t left = start;
size_t right = start + length - 1;
while (left <= right) {
if (((a[left] >> bit) & 1) == 0) {
left++;
} else {
std::swap(a[left], a[right]);
right--;
}
}
}
void sort(unsigned *a, size_t n) {
for (int bit = 0; bit < 32; bit++) {
partition(a, 0, n, bit);
}
}
Compilation | N/A | N/A | Compile Error | Score: N/A | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2025-04-05 23:51:48 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠