# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
629323 | jakubd | Rarest Insects (IOI22_insects) | C++17 | 252 ms | 45296 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;
vector<int> where, lastWhere;
void _move_inside(int x) {
where[x] = 1;
}
void _move_outside(int x) {
where[x] = 0;
}
map<vector<int>, int> memo;
int _press_button() {
if (memo.count(where)) return memo[where];
for (int i = 0; i < N; i++) {
if (where[i] == lastWhere[i]) continue;
if (where[i]) move_inside(i);
else move_outside(i);
}
lastWhere = where;
return memo[where] = press_button();
}
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... |