# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
116373 | zubec | Mechanical Doll (IOI18_doll) | C++14 | 2 ms | 204 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;
const int N = 200100;
int dir[N*4], n, sz;
pair<int, int> pr[N];
void add(int v, int l, int r, int x){
if (l == r){
//cout << "kek " << v << ' ' << v/2-sz/2+1 << ' ' << x << endl;
if (v % 2 == 0)
pr[v/2-sz/2+1].first = x; else
pr[v/2-sz/2+1].second = x;
return;
}
int mid = (l+r)>>1;
if (dir[v] == 0)
add(v+v, l, mid, x); else
add(v+v+1, mid+1, r, x);
dir[v] ^= 1;
}
void create_circuit(int M, std::vector<int> A) {
n = A.size();
vector <int> C, X, Y;
if (n == 1){
C.push_back(A[0]);
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... |