Submission #347422

#TimeUsernameProblemLanguageResultExecution timeMemory
347422juggernautThe Big Prize (IOI17_prize)C++14
90 / 100
90 ms640 KiB
#include"prize.h" #include<bits/stdc++.h> #ifdef EVAL #else #include"grader.cpp" #endif using namespace std; int mx; int find_best(int n){ for(int i=0;i<n;i++){ auto res=ask(i); if(!(res[0]|res[1]))return i; mx=max(mx,res[0]+res[1]); if(res[0]+res[1]!=mx)continue; int l=i,r=n-1; while(l<=r){ int mid=(l+r)>>1; auto rs=ask(mid); if(rs==res)l=mid+1,i=mid; else r=mid-1; } } }

Compilation message (stderr)

prize.cpp: In function 'int find_best(int)':
prize.cpp:23:1: warning: control reaches end of non-void function [-Wreturn-type]
   23 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...