Submission #638614

#TimeUsernameProblemLanguageResultExecution timeMemory
638614aris12345678Rarest Insects (IOI22_insects)C++17
10 / 100
397 ms284 KiB
#include "insects.h"
#include <bits/stdc++.h>
using namespace std;

int min_cardinality(int n) {
    vector<bool> vis(n, false);
    int ans = INT_MAX;
    for(int i = 0; i < n; i++) {
        if(vis[i]) continue;
        vector<bool> in_set_i(n, false);
        int cnt = 0;
        for(int j = i; j < n; j++) {
            move_inside(j);
            int now = press_button();
            if(now <= cnt)
                move_outside(j);
            else {
                cnt = now;
                vis[j] = true, in_set_i[j] = true;
            }
        }
        ans = min(ans, cnt);
        for(int j = i; j < n; j++) {
            if(in_set_i[j])
                move_outside(j);
        }
    }
    return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...