# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1095877 | owoovo | Highway Tolls (IOI18_highway) | C++17 | 73 ms | 2208 KiB |
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<bits/stdc++.h>
#define ll long long
#define F first
#define S second
using namespace std;
vector<int>w;
void find_pair(int N, std::vector<int> U, std::vector<int> V, int A, int B) {
int M = U.size();
w.resize(M);
for(auto x:w)x=0;
ll now=ask(w);
int l=0,r=M+1;
while(l<r-1){
int m=(l+r)>>1;
for(int i=0;i<M;i++)w[i]=0;
for(int i=0;i<m;i++){
w[i]=1;
}
ll ne=ask(w);
if(ne!=now){
r=m;
}else{
l=m;
}
}
int L=-1,R=M;
while(L<R-1){
int m=(L+R)>>1;
for(int i=0;i<M;i++)w[i]=0;
for(int i=M-1;i>=m;i--){
w[i]=1;
}
ll ne=ask(w);
if(ne!=now){
L=m;
}else{
R=m;
}
}
//cout<<l<<" "<<R<<"\n";
answer(l,R);
return ;
}
Compilation message (stderr)
# | 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... |