QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#533533 | #4564. Digital Circuit | Qwerty1232 | Compile Error | / | / | C++23 | 1.1kb | 2024-08-26 02:50:21 | 2024-08-26 02:50:22 |
Judging History
answer
#include "insects.h"
#include <numeric>
#include <vector>
int min_cardinality(int n) {
int beg = 0, end = n;
while (beg + 1 < end) {
int mid = (beg + end) / 2;
std::vector<bool> fucked(n);
std::vector<int> vec;
for (int i = 0; i < n; i++) {
move_inside(i);
if (mid < press_button()) {
fucked[i] = true;
move_outside(i);
} else {
vec.push_back(i);
}
}
for (int i : vec) {
move_outside(i);
}
vec.clear();
for (int i = n - 1; i >= 0; i--) {
move_inside(i);
if (mid < press_button()) {
fucked[i] = true;
move_outside(i);
} else {
vec.push_back(i);
}
}
for (int i : vec) {
move_outside(i);
}
vec.clear();
if (std::accumulate(fucked.begin(), fucked.end(), 0) == n) {
beg = mid;
} else {
end = mid;
}
}
return end;
}
詳細信息
answer.code:1:10: fatal error: insects.h: No such file or directory 1 | #include "insects.h" | ^~~~~~~~~~~ compilation terminated.