이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |