제출 #836311

#제출 시각아이디문제언어결과실행 시간메모리
836311rainboyFinding Routers (IOI20_routers)C++17
100 / 100
1 ms340 KiB
#include "routers.h" using namespace std; typedef vector<int> vi; const int N = 1000; int xx[N], cnt; void solve(int xl, int xr, int il, int ir) { if (il == ir) return; if (xr - xl == 1) { xx[cnt++] = xl; return; } int xm = (xl + xr) / 2, im = use_detector(xm); solve(xl, xm, il, im), solve(xm, xr, im, ir); } vi find_routers(int l, int n, int q) { cnt = 0, solve(0, l, 0, n - 1); vi xx_(n, 0); for (int i = 0; i + 1 < n; i++) xx_[i + 1] = xx[i] * 2 - xx_[i]; return xx_; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...