Submission #756125

#TimeUsernameProblemLanguageResultExecution timeMemory
756125drdilyorHighway Tolls (IOI18_highway)C++17
0 / 100
38 ms496 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, weather.end(), 1); if (ask(weather) > toll) { l = mid; } else r = mid-1; } answer(s, l+1); }
#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...