Submission #290076

#TimeUsernameProblemLanguageResultExecution timeMemory
290076SamAndThe Big Prize (IOI17_prize)C++17
20 / 100
119 ms384 KiB
#include "prize.h"
#include <bits/stdc++.h>
using namespace std;
#define m_p make_pair
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
typedef long long ll;

int find_best(int n)
{
    int l = 0, r = n - 1;
    while (l <= r)
    {
        int m = (l + r) / 2;
        vector<int> v = ask(m);
        if (v[0])
            r = m - 1;
        else if (v[1])
            l = m + 1;
        else
            return m;
    }
}

Compilation message (stderr)

prize.cpp: In function 'int find_best(int)':
prize.cpp:25:1: warning: control reaches end of non-void function [-Wreturn-type]
   25 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...