# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1075776 | 2024-08-26T09:07:45 Z | mdn2002 | The Big Prize (IOI17_prize) | C++17 | 54 ms | 344 KB |
#include "prize.h" #include<bits/stdc++.h> using namespace std; int find_best(int n) { int mx = 0, lim = 500, mxleft = 0; for (int i = 0; i < min(n, lim); i ++) { vector<int> a = ask(i); mx = max(mx, a[0] + a[1]); mxleft = max(mxleft, a[0]); if (a[0] + a[1] == 0) return i; } for (int i = 0; i < n; i ++) { vector<int> a = ask(i); int num = mxleft - a[1], logg = log2(num) + 1; if (a[0] + a[1] == mx) { for (int j = (1 << 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
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 54 ms | 344 KB | Incorrect |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 53 ms | 344 KB | Incorrect |
2 | Halted | 0 ms | 0 KB | - |