Submission #227975

#TimeUsernameProblemLanguageResultExecution timeMemory
227975AaronNaiduThe Big Prize (IOI17_prize)C++14
20 / 100
5 ms384 KiB
#include <bits/stdc++.h>
#include "prize.h"
using namespace std;




int find_best(int n) {
    int minn = 0;
    int maxx = n-1;
    while (minn <= maxx)
    {
        int med = (minn + maxx)/2;
        vector<int> v = ask(med);
        if (v[0] == 0 and v[1] == 0)
        {
            return med;
        }
        if (v[0] == 0 and v[1] == 1)
        {
            minn = med + 1;
        }
        else
        {
            maxx = med - 1;
        }
        
    }
    return minn;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...