Submission #527387

#TimeUsernameProblemLanguageResultExecution timeMemory
527387andreiomdThe Big Prize (IOI17_prize)C++11
20 / 100
95 ms352 KiB
#include "prize.h" using namespace std; int find_best (int n) { int left = 0, right = n - 1, pos = -1; while(left <= right) { int mid = ((left + right) >> 1); vector < int > ans = ask(mid); if(ans[0] == 0 && ans[1] == 0) return mid; if(ans[0] == 1) right = mid - 1; else left = mid + 1; } }

Compilation message (stderr)

prize.cpp: In function 'int find_best(int)':
prize.cpp:7:34: warning: unused variable 'pos' [-Wunused-variable]
    7 |     int left = 0, right = n - 1, pos = -1;
      |                                  ^~~
prize.cpp:22:1: warning: control reaches end of non-void function [-Wreturn-type]
   22 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...