Submission #1008486

#TimeUsernameProblemLanguageResultExecution timeMemory
1008486oyberRarest Insects (IOI22_insects)C++17
25 / 100
256 ms596 KiB
#include "insects.h" #include <bits/stdc++.h> using namespace std; int min_cardinality(int N) { vector<bool> used(N); int types = 0; for (int i = 0; i < N; i++) { move_inside(i); if (press_button() > 1) { move_outside(i); continue; } types++; used[i] = true; } //printf("types: %d\n", types); for (int num = 2; num <= N; num++) { int added = 0; for (int i = 0; i < N; i++) { if (used[i]) continue; move_inside(i); int p = press_button(); //printf("num: %d i: %d p: %d\n", num, i, p); if (p > num) { move_outside(i); continue; } added++; used[i] = true; if (added == types) break; } if (added != types) { return num-1; } } return N; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...