제출 #526241

#제출 시각아이디문제언어결과실행 시간메모리
526241ntabc05101자동 인형 (IOI18_doll)C++14
84 / 100
111 ms9364 KiB
//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); y.resize(cr); 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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...