This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |