Submission #611408

#TimeUsernameProblemLanguageResultExecution timeMemory
611408ShithilaThe Big Prize (IOI17_prize)C++14
20 / 100
82 ms296 KiB
#include "prize.h" int find_best(int n) { int start=0; int end=n-1; int found=false; while(found==false) { int check=start+end; check=check/2; std::vector<int> res = ask(check); if(res[0]==0 && res[1]==0) { return check; found==true; } else if(res[0]==1) { end=check; } else if(res[1]==1) { start=check; } if(start==end-1) { if(check==start) { return end; found==true; } else { return start; found==true; } } } }

Compilation message (stderr)

prize.cpp: In function 'int find_best(int)':
prize.cpp:15:9: warning: statement has no effect [-Wunused-value]
   15 |    found==true;
      |    ~~~~~^~~~~~
prize.cpp:30:10: warning: statement has no effect [-Wunused-value]
   30 |     found==true;
      |     ~~~~~^~~~~~
prize.cpp:35:10: warning: statement has no effect [-Wunused-value]
   35 |     found==true;
      |     ~~~~~^~~~~~
prize.cpp:39:1: warning: control reaches end of non-void function [-Wreturn-type]
   39 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...