Submission #282051

#TimeUsernameProblemLanguageResultExecution timeMemory
282051Pichon5The Big Prize (IOI17_prize)C++17
0 / 100
82 ms288 KiB
#include <bits/stdc++.h> #include "prize.h" using namespace std; int find_best(int n) { int a=0,b=n-1; while(a<=b){ int mid=(a+b)/2; vector<int>v=ask(mid); if(v[0]==0 && v[1]==0){ return mid; } if(v[0]=1){ a=mid+1; }else{ b=mid-1; } } }

Compilation message (stderr)

prize.cpp: In function 'int find_best(int)':
prize.cpp:12:16: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   12 |         if(v[0]=1){
prize.cpp:18:1: warning: control reaches end of non-void function [-Wreturn-type]
   18 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...