Submission #1075795

#TimeUsernameProblemLanguageResultExecution timeMemory
1075795mdn2002The Big Prize (IOI17_prize)C++14
20 / 100
61 ms432 KiB
#include "prize.h" #include<bits/stdc++.h> using namespace std; int find_best(int n) { int mx = 0, lim = 500; for (int i = 0; i < min(n, lim); i ++) { vector<int> a = ask(i); mx = max(mx, a[0] + a[1]); if (a[0] + a[1] == 0) return i; } for (int i = 0; i < n; i ++) { vector<int> a = ask(i); int logg = 600; if (a[0] + a[1] == mx) { for (int j = logg; j >= 1; j /= 2) { if (i + j >= n) continue; vector<int> b = ask(i + j); if (a[1] == b[1]) i += j; } } else if (a[0] + a[1] == 0) return i; } }

Compilation message (stderr)

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