Submission #474464

#TimeUsernameProblemLanguageResultExecution timeMemory
474464aris12345678The Big Prize (IOI17_prize)C++14
20 / 100
1 ms320 KiB
#include "prize.h"
#include <bits/stdc++.h>
using namespace std;

const int mxN = 200005;

// vector<int> ask(int i) {
//     int a, b;
//     cout << i << "\n";
//     scanf("%d %d", &a, &b);
//     return {a, b};
// }

int find_best(int n) {
    int st = 0, en = n-1, md;
    while(st <= en) {
        md = (st+en)/2;
        vector<int> p = ask(md);
        if(p[0] == 0 && p[1] == 0)
            return md;
        else if(p[0] == 1)
            en = md-1;
        else
            st = md+1;
    }
    return -1;
}

// int main() {
//     int n;
//     scanf("%d", &n);
//     printf("%d\n", find_best(n));
//     return 0;
// }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...