Submission #1074697

#TimeUsernameProblemLanguageResultExecution timeMemory
1074697NicolaikrobRarest Insects (IOI22_insects)C++17
25 / 100
262 ms344 KiB
#include "insects.h" #include <bits/stdc++.h> using namespace std; int min_cardinality(int N) { // Find the number of different insect types: // Maximum number of insects with 1 being maximum // Let that number be K // Find another set of K numbers with 2 being the maximum // Then 3 and 4 and so on untill it is no longer possible // The grader is not adaptive: vector<int> indicies(N); iota(indicies.begin(), indicies.end(), 0); vector<int> in(N); int k = 0; for (int i = 0; i < N; i++) { move_inside(indicies[i]); if (press_button() > 1) { move_outside(indicies[i]); } else { k++; in[i] = 1; } } int res = 1; while (true) { int cnt = 0; for (int i = 0; i < N && cnt < k; i++) { if (in[i]) continue; move_inside(indicies[i]); if (press_button() > res + 1) { move_outside(indicies[i]); } else { cnt++; in[i] = 1; } } if (cnt < k) return res; res++; } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...