# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1051176 | Trent | Rarest Insects (IOI22_insects) | C++17 | 204 ms | 600 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;
#define forR(i, x) for(int i = 0; i < (x); ++i)
#define REP(i, a, b) for(int i = (a); i < (b); ++i)
#define all(x) x.begin(), x.end()
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<bool> vb;
int min_cardinality(int N) {
vvi dst;
set<int> vals;
forR(i, N) vals.insert(i);
while(dst.size() <= 1 || dst[dst.size() - 1].size() == dst[dst.size() - 2].size()) {
dst.emplace_back();
for(int i : vals) {
move_inside(i);
if(press_button() == dst.size()) {
dst.back().push_back(i);
} else {
move_outside(i);
}
}
for(int i : dst.back()) vals.erase(vals.find(i));
}
// for(vi& i : dst) {
// for(int j : i) cerr << j << ' ';
// cerr << '\n';
// }
return dst.size() - 1;
}
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... |