Submission #265005

#TimeUsernameProblemLanguageResultExecution timeMemory
265005arayiThe Big Prize (IOI17_prize)C++17
20 / 100
58 ms384 KiB
#include "prize.h" #include <algorithm> using namespace std; int as(int a) { vector <int> fp = ask(a); if(fp[0] + fp[1] == 0) return 0; if(fp[0]) return -1; return 1; } int find_best(int n) { int l = 0, r = n - 1; while(l <= r) { int mid = (l + r)/2; int sm = as(mid); if(sm == 0) return mid; if(sm == 1) l = mid + 1; if(sm == -1) r = mid - 1; } }

Compilation message (stderr)

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