Submission #1214571

#TimeUsernameProblemLanguageResultExecution timeMemory
1214571exoworldgdThe Big Prize (IOI17_prize)C++20
0 / 100
1071 ms404 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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...