이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//why am i so stupid?
#include<bits/stdc++.h>
#include "doll.h"
using namespace std;
const int mxN = 1 << 18;
int n, p = 1, cr = 0;
vector<int> x(mxN), y(mxN);
bool e[mxN];
int bld(int l, int r) {
	if (l >= r) {
		return 0;
	}
	if (r < p - n) {
		return -1;
	}
	int z = ++cr, mid = l + r >> 1;
	x[z - 1] = bld(l, mid);
	y[z - 1] = bld(mid + 1, r);
	return -z;
}
void ptr(int z, int t) {
	auto &a = e[-z - 1] ? y[-z - 1]: x[-z - 1];
	e[-z - 1] ^= 1;
	if (!a) {
		a = t;
	}
	else {
		ptr(a, t);
	}
}
void create_circuit(int m, vector<int> a) {
	n = a.size();
	for (; p < n; p <<= 1);
	bld(0, p - 1);
	for (int i = 1; i < n; i++) {
		ptr(-1, a[i]);
	}
	if (n & 1) {
		ptr(-1, -1);
	}
	ptr(-1, 0);
	vector<int> c(m + 1, -1);
	c[0] = a[0];
	x.resize(cr + 1);
	y.resize(cr + 1);
	answer(c, x, y);
}
컴파일 시 표준 에러 (stderr) 메시지
doll.cpp: In function 'int bld(int, int)':
doll.cpp:21:24: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   21 |  int z = ++cr, mid = l + r >> 1;
      |                      ~~^~~| # | 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... |