제출 #1024380

#제출 시각아이디문제언어결과실행 시간메모리
102438012345678Finding Routers (IOI20_routers)C++17
39 / 100
1 ms600 KiB
#include "routers.h" #include <bits/stdc++.h> using namespace std; const int nx=1e3+5; vector<int> f(nx); void solve(int l, int r, int ql, int qr) { if (qr<ql) return; if (l==r) return f[ql]=l, void(); int md=(l+r)/2, t=use_detector(md); solve(l, md, ql, t); solve(md+1, r, t+1, qr); } vector<int> find_routers(int L, int n, int q) { int lst=0; vector<int> res(n); solve(1, L-1, 1, n-1); for (int i=1; i<n; i++) { int cnt=f[i]-lst-2; res[i]=f[i]+cnt; lst=res[i]; } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...