# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1172708 | anmattroi | Mechanical Doll (IOI18_doll) | C++17 | 72 ms | 11164 KiB |
#include "doll.h"
#include <bits/stdc++.h>
#define maxn 400005
#define fi first
#define se second
using namespace std;
using ii = pair<int, int>;
int N, nho, nt, cnt;
vector<int> a, X, Y;
int parity[maxn];
int build(int lo, int hi) {
if (nho >= hi-lo+1) {
nho -= hi-lo+1;
return 1;
}
if (lo == hi)
return INT_MAX/2;
int mid = (lo + hi) >> 1, cur = ++nt;
X[cur-1] = -build(lo, mid);
Y[cur-1] = -build(mid+1, hi);
return cur;
}
void dfs(int u, int lo, int hi) {
if (lo == hi) {
X[u-1] = a[cnt]; ++cnt;
return;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |