Submission #428688

#TimeUsernameProblemLanguageResultExecution timeMemory
428688Dremix10The Big Prize (IOI17_prize)C++17
20 / 100
1 ms412 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
#define endl '\n'
#define F first
#define S second
#define all(x) (x).begin(),(x).end()
const int N = 3e5+1;
const ll INF = 2e18;
const int MOD = 1e9+7;

vector<int> ask(int i);

int find_best(int n) {
    int l = 0,r = n-1;
    int ans = -1;

    while(l<=r){
        int mid = (l+r)/2;
        vector<int> arr = ask(mid);
        assert(arr[0]+arr[1] <= 1);
        if(arr[0] == 1)
            r = mid-1;
        else if(arr[1] == 1)
            l = mid+1;
        else{
            ans = mid;
            break;
        }
    }
    return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...