# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
629620 | study | Rarest Insects (IOI22_insects) | C++17 | 57 ms | 304 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "insects.h"
using namespace std;
int min_cardinality(int N) {
vector<int> a(N);
for (int i=0; i<N; ++i){
a[i] = i;
}
// random_shuffle(a.begin(),a.end());
bitset<2000> inside;
int nbElems = 0;
for (int i=0; i<N; ++i){
move_inside(a[i]);
if (i != 0){
int maxFreq = press_button();
if (maxFreq > 1) move_outside(a[i]);
else{
++nbElems;
inside[a[i]] = true;
// cout << a[i] << endl;
}
}
else{
++nbElems;
inside[a[i]] = true;
// cout << a[i] << endl;
}
}
if (nbElems == 1) return N;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |