Submission #296900

#TimeUsernameProblemLanguageResultExecution timeMemory
296900DovranThe Big Prize (IOI17_prize)C++11
0 / 100
0 ms256 KiB
#include <bits/stdc++.h> #include "prize.h" #define N 300009 #define pii pair <int, int> #define ff first #define ss second #define pb push_back #define ll long long using namespace std; int find_best(int n){ int l=0, r=n-1; int ans; while(l>=r){ int md=(l+r)/2; vector<int>e=ask(md); if(e[0]+e[1]>1){ ans=3; break; } if(!e[0] and !e[1]){ ans=md; break; } if(e[0]>0) r=md-1; else l=md+1; } return ans; }

Compilation message (stderr)

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