Submission #427104

#TimeUsernameProblemLanguageResultExecution timeMemory
427104MOUF_MAHMALATThe Big Prize (IOI17_prize)C++14
20 / 100
138 ms320 KiB
#include "prize.h" #include<bits/stdc++.h> using namespace std; typedef int ll; vector<ll>v,w,x; int find_best(int n) { v=ask(0); for(ll i=99; i<n; i+=100) { w=ask(i); if(w[0]+w[1]==0) return i; if(v!=w) { for(ll j=i-99; j<i; j++) { x=ask(j); if(x[0]+x[1]==0) return j; } v=w; } } for(ll i=n-1; i>=max(0,n-99); i--) { v=ask(i); if(v[0]+v[1]==0) return i; } }

Compilation message (stderr)

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