# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
835028 | pavement | Rarest Insects (IOI22_insects) | C++17 | 86 ms | 2820 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 pb push_back
vector<int> cur_v, perm;
map<vector<int>, int> qry_mem;
int qry(vector<int> v) {
sort(v.begin(), v.end());
vector<int> chng;
set_symmetric_difference(v.begin(), v.end(), cur_v.begin(), cur_v.end(), back_inserter(chng));
for (int i : chng) {
if (binary_search(v.begin(), v.end(), i)) {
move_inside(perm[i]);
} else {
move_outside(perm[i]);
}
}
cur_v = v;
if (qry_mem.find(cur_v) != qry_mem.end()) {
return qry_mem[cur_v];
}
return qry_mem[cur_v] = press_button();
}
mt19937 rng(998244353);
int min_cardinality(int N) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |