# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
64602 | 2018-08-05T03:08:15 Z | nvmdava | The Big Prize (IOI17_prize) | C++14 | 18 ms | 5368 KB |
#include "prize.h" #include <bits/stdc++.h> using namespace std; vector<int> ans[210000]; int mx = -1; int find_best(int n) { for(int i = 0; i < 500; i++){ ans[i] = ask(i); if(ans[i][0] + ans[i][1] == 0){ return i; } mx = max(mx, ans[i][0] + ans[i][1]); } int id = 0; while(id < n){ ans[id] = ask(id); while(ans[id][0] + ans[id][1] != mx){ id++; ans[id] = ask(id); if(ans[id][0] + ans[id][1] == 0) return id; } int l = id, r = n - 1; int k = 0; while(l <= r) { int m = (l + r) >> 1; ans[m] = ask(m); if(ans[m][1] != ans[id][1] || ans[m][0] + ans[m][1] < mx) r = m - 1; else { l = m + 1; k = m; } } id = k + 1; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 18 ms | 5368 KB | Integer 200000 violates the range [0, 199999] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 17 ms | 5368 KB | Integer 200000 violates the range [0, 199999] |
2 | Halted | 0 ms | 0 KB | - |