# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
384937 | arman_ferdous | Mechanical Doll (IOI18_doll) | C++17 | 134 ms | 11820 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 "doll.h"
#include <bits/stdc++.h>
using namespace std;
#define sz(v) (int)v.size()
const int M = (1 << 19);
int x[M], y[M], cnt[M], maxSwitch;
void build(int u, int L, int R) {
maxSwitch = max(maxSwitch, u);
cnt[u] = 0;
if(L == R) return;
int mid = L + R >> 1, lc = u << 1, rc = lc | 1;
x[u] = lc, y[u] = rc;
build(lc, L, mid); build(rc, mid + 1, R);
}
void insert(int u, int L, int R, int nxt) {
if(L == R) {
if(~cnt[u] & 1) x[u] = -nxt;
else y[u] = -nxt;
cnt[u] ^= 1;
return;
} int mid = L + R >> 1, lc = u << 1, rc = lc | 1;
if(~cnt[u] & 1) {
cnt[u] ^= 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |