Submission #83037

#TimeUsernameProblemLanguageResultExecution timeMemory
83037ioilolcomThe Big Prize (IOI17_prize)C++14
20 / 100
63 ms576 KiB
#include "prize.h" int find_best(int n) { int l=0; int r=n-1; int mid; while(l<=r) { mid=(l+r)/2; std::vector<int> res = ask(mid); if(res[1]==1) { l=mid+1; } else if(res[0]==1) { r=mid-1; } else if(res[0]==0&&res[1]==0) { return mid; } } return mid; }

Compilation message (stderr)

prize.cpp: In function 'int find_best(int)':
prize.cpp:7:6: warning: 'mid' may be used uninitialized in this function [-Wmaybe-uninitialized]
  int mid;
      ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...