QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#533533#4564. Digital CircuitQwerty1232Compile Error//C++231.1kb2024-08-26 02:50:212024-08-26 02:50:22

Judging History

你现在查看的是最新测评结果

  • [2024-08-26 02:50:22]
  • 评测
  • [2024-08-26 02:50:21]
  • 提交

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.