# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
641454 | TimDee | Rarest Insects (IOI22_insects) | C++17 | 78 ms | 328 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 "insects.h"
#include <bits/stdc++.h>
using namespace std;
int n,d;
vector<int> in(2005,0);
vector<int> uniq;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int min_cardinality(int N) {
n=N;
d=0;
vector<int> use;
for (int i=0; i<n; ++i) {
use.push_back(i);
}
shuffle(use.begin(), use.end(),rng);
for(int i=0; i<n; ++i) {
move_inside(use[i]);
int x=press_button();
if (x>1) move_outside(use[i]);
else { in[use[i]]=1; ++d; }
}
for (int i=0; i<n; ++i) if (in[i]) uniq.push_back(i);
if (d==1) return n;
if (d>n/2) return 1;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |