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>
using namespace std;
#define ll long long
#define pb push_back
typedef pair<ll,ll> pii;
const ll MAXN = 2e5+5;
const ll INF = 1e9+7;
ll n,M,W;
ll find(){
ll lo=0,hi=M-1,mid,i,x;
while(hi>lo){
mid = lo + (hi-lo)/2;//cout<<hi<<" "<<lo<<" "<<mid<<" ";
std::vector<int> w(M);
for(i=0;i<M;i++){w[i] = i<=mid ;}
x=ask(w);
cout<<x<<endl;
if(x>W){
hi=mid;
}else{
lo=mid+1;
}
}
return hi;
}
void find_pair(int N, std::vector<int> U, std::vector<int> V, int A, int B) {
M = U.size();
n=N;
std::vector<int> w(M);
W = ask(w);
ll s=find();
// cout<<s<<"\n";
answer(s,s+(W/A));
}
# | 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... |