# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
143189 | neki | 통행료 (IOI18_highway) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "highway.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void find_pair(int N, std::vector<int> U, std::vector<int> V, int A, int B) {
ll M=U.size(), st=0;
vector<int> arr;arr.resize(M, 0);ll req=ask(arr);
while(st!=M){
ll l=st, r=M;
while(l<r){
ll mid=(l+r)/2;
loop(i, st, M) arr[i]=(i<=mid);
if(ask(arr)==req) l=mid+1;
else r=mid;
}
arr[l]=0;st=l+1;
}
vector<int> temp(N, 0), ans;
loop(i, 0, M) if(!arr[i]) temp[U[i]]++,temp[V[i]]++;
loop(i, 0, N) if(temp[i]==1) ans.push_back(i);
answer(ans[0], ans[1]);
}