# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1078784 | Gromp15 | Rarest Insects (IOI22_insects) | C++17 | 104 ms | 928 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>
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#include "insects.h"
using namespace std;
template<typename T> bool ckmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<typename T> bool ckmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }
int min_cardinality(int N) {
vector<int> groups{0};
move_inside(0);
for (int i = 1; i < N; i++) {
move_inside(i);
if (press_button() > 1) move_outside(i);
else groups.push_back(i);
}
for (int x : groups) move_outside(x);
if (sz(groups) >= 230) {
vector<int> rest(N);
iota(all(rest), 0);
for (int x : groups) rest.erase(find(all(rest), x));
int ans = 1;
while (rest.size()) {
vector<int> groups2{rest[0]};
move_inside(rest[0]);
for (int i = 1; i < sz(rest); i++) {
move_inside(rest[i]);
if (press_button() > 1) move_outside(rest[i]);
else groups2.push_back(rest[i]);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |