# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1202067 | AMel0n | Finding Routers (IOI20_routers) | C++20 | 0 ms | 0 KiB |
// BROO NO HATE PLS
// IM ON MOBILE
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(i,N) for(ll i = 0; i < N; i++)
#define F first
#define S second
#define all(x) (x).begin(),(x).end()
#include "routers.h"
vector<int> find_routers(int l, int n, int q) {
vector<int> res(n);
vector<int> ris(n, l+1);
for(int i = 1; i < n; i++) {
int le = res[i-1], ri = ris[i];
while(le < ri - 1) {
int mi = (le + ri) / 2;
int im = use_detector(mi);
if (i <= im) {
ri = mi;
for(int j = i + 1; j <= im; j++) ris[j] = min(ris[j], m);
}
else le = mi;
}
res[i] = le * 2 - res[i - 1];
}
return res;
}