# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
666935 | flappybird | Prisoner Challenge (IOI22_prison) | C++17 | 15 ms | 1236 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 "prison.h"
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
#define MX 5000
#define MAX 5000
vector<int> tree[MAX];
int cnt = 1;
int dep[MAX];
vector<int> cnum = { 3, 3, 3, 3, 3, 3, 2 };
int dv[MAX] = { 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7 };
int pl[MAX] = { 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1 };
int ind[MAX] = { 0, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1 };
int vloc[MAX];
pii range[MAX];
int make_tree(int l, int r, int x = 1, int d = 0) {
dep[x] = d;
range[x] = { l, r };
if (r - l <= 1) return x;
int intv = (r - l - 1 + cnum[d] - 1) / cnum[d];
for (int i = 0; i < cnum[d]; i++) {
tree[x].push_back(make_tree(l + i * intv + 1, l + i * intv + intv, ++cnt, d + 1));
vloc[tree[x].back()] = i;
}
return x;
}
bool chk(pii p, int x) {
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... |