Submission #140099

#TimeUsernameProblemLanguageResultExecution timeMemory
140099davitmargThe Big Prize (IOI17_prize)C++17
20 / 100
3 ms380 KiB
//DM #include <iostream> #include <cmath> #include <algorithm> #include <vector> #include <string> #include <cstring> #include <map> #include <set> #include <queue> #include "prize.h" #define LL long long #define mod 1000000007ll #define MP make_pair #define PB push_back #define all(v) v.begin(),v.end() using namespace std; int find_best(int n) { int l=0,r=n-1,m,pos; while(l<=r) { m=(l+r)/2; if(!ask(m)[0]) { pos=m; l=m+1; } else r=m-1; } return pos; } /* int main() { return 0; } */ /* */

Compilation message (stderr)

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