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<bits/stdc++.h>
#include "highway.h"
using namespace std;
//#define int long long
const int MAX_SOM=90*1000;
int nbSom,bas,haut,nbAre,distTotal,petit,grand,mid,rep;
vector<int> quest;
void find_pair(int N,vector<int> U,vector<int> V,int A,int B) {
nbAre=U.size();
nbSom=N;
bas=A;
haut=B;
for (int i=0;i<nbAre;i++) {
quest.push_back(0);
}
distTotal=ask(quest);
petit=0;
grand=nbAre-distTotal;
while(petit!=grand) {
mid=(petit+grand)/2;
for (int i=petit;i<=mid;i++) {
quest[i]=1;
}
rep=ask(quest);
for (int i=petit;i<=mid;i++) {
quest[i]=0;
}
if (rep>distTotal) {
grand=mid;
}
else {
petit=mid+1;
}
}
answer(petit,petit+distTotal);
}
# | 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... |