제출 #423649

#제출 시각아이디문제언어결과실행 시간메모리
423649Tangent통행료 (IOI18_highway)C++17
6 / 100
127 ms2156 KiB
#include "highway.h" #include "bits/stdc++.h" using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<int> vii; typedef vector<ll> vll; typedef vector<pii> vpii; typedef vector<pll> vpll; typedef vector<vii> vvii; typedef vector<vll> vvll; typedef vector<vpii> vvpii; typedef vector<vpll> vvpll; #define ffor(i, a, b) for (ll i = a; i < b; i++) #define rep(i, n) ffor(i, 0, n) #define forin(x, a) for (auto &x: a) #define all(a) a.begin(), a.end() void find_pair(int N, std::vector<int> U, std::vector<int> V, int A, int B) { int M = U.size(); ll dist = ask(vii(M)) / A; int lo = 0, hi = N - 1 - dist; vii query(M); while (lo < hi) { int mid = (lo + hi) / 2; for (int x = mid; x >= 0; x-= dist) { query[x] = 1; } if (ask(query) > dist * A) { hi = mid; } else { lo = mid + 1; } for (int x = mid; x >= 0; x-= dist) { query[x] = 0; } } answer(lo, lo + dist); }
#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...