Submission #1079010

#TimeUsernameProblemLanguageResultExecution timeMemory
1079010NourWaelRarest Insects (IOI22_insects)C++17
10 / 100
256 ms344 KiB
#include "insects.h" #include <bits/stdc++.h> //#include "stub.cpp" using namespace std; int n; set<int> st; map<int,int> mp; int min_cardinality(int N) { n = N; int mini = n; for(int i=0; i<n; i++) st.insert(i); while(st.size()) { int cnt = 1, i = (*st.begin()); st.erase(st.begin()); if(st.size()) move_inside(i); vector<int> e; for(auto it:st) { move_inside(it); int g = press_button(); if(g==2) { cnt++; e.push_back(it); } move_outside(it); } if(st.size()) move_outside(i); mini = min(mini, cnt); for(auto it:e) st.erase(it); } return mini; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...