Submission #227973

#TimeUsernameProblemLanguageResultExecution timeMemory
227973AaronNaiduThe Big Prize (IOI17_prize)C++14
0 / 100
5 ms512 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 0;
        }
        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...