Submission #1053285

#TimeUsernameProblemLanguageResultExecution timeMemory
1053285UnforgettableplThe Big Prize (IOI17_prize)C++17
20 / 100
46 ms432 KiB
#include "prize.h" #include <bits/stdc++.h> using namespace std; const int THRESHOLD = 50; const int BIGGER_JUMP = 1024; int find_best(int n){ for(int i=0;i<n;i++) { auto base = ask(i); int curr = base[0]+base[1]; if(curr==0)return i; if(curr>THRESHOLD) { for(int jump=BIGGER_JUMP;jump;jump/=2) { if(i+jump>=n)continue; auto temp = ask(i+jump); if(temp==base)i+=jump; } } else { for(int jump=256;jump;jump/=2) { if(i+jump>=n)continue; auto temp = ask(i+jump); if(temp==base)i+=jump; } } } }

Compilation message (stderr)

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