이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "highway.h"
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
#define pb push_back
#define sz(a) (int)a.size()
#define all(a) begin(a),end(a)
const int mxN = (int)2e5+10;
using ll = long long;
vector<pair<int,int>> adj[mxN];
int n, m, dist, dis[mxN];
void find_pair(int N, vi u, vi v, int A, int B) {
n = N; m = sz(u); vi w(m,0);
ll toll = ask(w);
int l = 0, r = m-1;
while(l<r){
int mid = (l+r)/2; fill(all(w),0);
fill(begin(w),begin(w)+mid+1,1);
if(ask(w)!=toll) r=mid;
else l=mid+1;
}
int x = l; l = 0, r = m-1;
while(l<r){
int mid = (l+r+1)/2; fill(all(w),0);
fill(begin(w)+mid,end(w),1);
if(ask(w)!=toll) l=mid;
else r=mid-1;
}
answer(x,l+1);
}
| # | 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... |