#include "highway.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vl vector<ll>
#define pb push_back
#define pll pair<ll, ll>
#define vs vector<string>
#define vb vector<bool>
#define all(aaa) aaa.begin(), aaa.end()
#define rall(aaa) aaa.rbegin(), aaa.rend()
#define ff(aa, bb, cc) for(ll aa = bb; aa < cc; aa++)
#define IO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ed "\n"
#define fi first
#define se second
ll MOD = 1e9+7;
/*
ll A, B, N, s_, t_;
ll ask(vl p){
ll c = 0;
ff(i, s_, t_){
if(p[i] == 0){
c += A;
}
else{
c += B;
}
}
cout << "ASK " << c << ed;
for(ll q : p){
cout << q;
}
cout << ed;
return c;
}
ll qq = 0, qqq = 0;
void answer(ll a, ll b){
qq = a;
qqq = b;
cout << ed << "================== " << a << " " << b << ed;
}
*/
void find_pair(int n, vector<int> U, vector<int> V, int a, int b){
ll m = U.size();
vector<int> empty(m, 0);
ll dist = ask(empty);
dist /= a;
//cout << "DIST " << dist << ed;
ll l = 0, r = m+1;
while(r-l > 1){
ll mid = (l+r)/2;
vector<int> cur = empty;
fill(cur.begin(), cur.begin()+mid, 1);
ll x = ask(cur);
if(x == dist*a){
//cout << "C1" << ed;
l = mid;
}
else{
//cout << "C2" << ed;
r = mid;
}
}
r--;
//cout << "AAAAAAAAAAA " << r << " " << U[r] << ed;
answer(r, r+dist);
return;
}
/*
int main(){
cin >> N >> A >> B >> s_ >> t_;
vector<int> q1(N-1), q2(N-1);
ff(i, 0, N-1){
cin >> q1[i] >> q2[i];
}
find_pair(N, q1, q2, A, B);
return 0;
}
*/
# | 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... |