Submission #756173

#TimeUsernameProblemLanguageResultExecution timeMemory
756173drdilyorHighway Tolls (IOI18_highway)C++17
0 / 100
14 ms508 KiB
#include "highway.h" #include<iostream> using namespace std; using ll = long long; void find_pair(int n, std::vector<int> u, std::vector<int> v, int a, int b) { int m = u.size(); int l = 0, r = n-2; ll toll = ask(vector<int>(m, 0)); while (l < r) { int mid = (l+r) / 2; vector<int> weather(m, 0); fill(weather.begin(), weather.begin() + mid+1, 1); if (ask(weather) == toll) { l = mid+1; } else r = mid; } int s = l; l = 1, r = n-1; while (l < r) { int mid = (l+r) / 2; vector<int> weather(m, 0); fill(weather.begin()+mid+1, weather.end(), 1); if (ask(weather) > toll) { l = mid+1; } else r = mid; } answer(s, l); }
#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...