# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1214571 | exoworldgd | The Big Prize (IOI17_prize) | C++20 | 1071 ms | 404 KiB |
#include "prize.h"
#include <bits/stdc++.h>
using namespace std;
map<int,vector<int>> mp;
vector<int> q(int idx) {
if (mp.count(idx)) return mp[idx];
return mp[idx] = ask(idx);
}
int find_best(int n) {
mp.clear();
int pos = 0;
while (pos < n) {
vector<int> res = q(pos);
if (res[0]+res[1] == n-1) return pos;
pos = res[0]+1;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |