# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1057798 | MercubytheFirst | Rarest Insects (IOI22_insects) | C++17 | 1 ms | 344 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;
using ll = long long;
int min_cardinality(int N) {
int type_cnt = 0;
vector<int> type(N, -1);
type[0] = 0;
for(int i = 0; i < N; ++i) {
if(type[i] == -1) {
type[i] = i;
}
else {
continue;
}
move_inside(i);
for(int j = i + 1; j < N; ++j) {
if(type[j] != -1) {
continue;
}
move_inside(j);
const int c = press_button();
if(c == 2) {
type[j] = type[i];
}
move_outside(j);
}
move_outside(i);
}
vector<int> cnt(N);
for(int x : type) {
assert(x != -1);
cnt[x]++;
}
return *min_element(cnt.begin(), cnt.end());
}
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... |