이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |