제출 #720735

#제출 시각아이디문제언어결과실행 시간메모리
720735nguyentunglam드문 곤충 (IOI22_insects)C++17
10 / 100
336 ms308 KiB
#include "insects.h"
#include<bits/stdc++.h>
using namespace std;
const int N = 2e3 + 10;
bool mark[N];
int min_cardinality(int n) {
    int res = n;
    for(int i = 0; i < n; i++) if (!mark[i]) {
        int cur = 0;
        vector<int> lst;
        for(int j = i; j < n; j++) if (!mark[j]) {
            move_inside(j);
            int nxt = press_button();
            if (cur < nxt) cur = nxt, mark[j] = 1, lst.push_back(j);
            else move_outside(j);
        }
        for(int &j : lst) move_outside(j);
        res = min(res, cur);
    }
    return res;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...