Submission #619835

#TimeUsernameProblemLanguageResultExecution timeMemory
619835OzyThe Big Prize (IOI17_prize)C++17
20 / 100
76 ms292 KiB
#include "prize.h" #include <bits/stdc++.h> using namespace std; #define lli long long int #define rep(i,a,b) for (int i = (a); i <= (b); i++) #define repa(i,a,b) for (int i = (a); i >= (b); i--) #define debug(a) cout << #a << " = " << a << endl #define debugsl(a) cout << #a << " = " << a << ", " vector<int> a; int find_best(int n) { lli ini = 0; lli fin = n-1; lli mitad; while (ini <= fin) { mitad = (ini+fin)/2; a = ask(mitad); if (a[0] == 0 && a[1] == 0) return mitad; else if (a[0] == 1) fin = mitad-1; else ini = mitad+1; } }

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...