Submission #1030293

# Submission time Handle Problem Language Result Execution time Memory
1030293 2024-07-22T02:19:22 Z shiomusubi496 The Big Prize (IOI17_prize) C++17
20 / 100
3 ms 5036 KB
#include "prize.h"

#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep2(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define rrep(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define rrep2(i, a, b) for (int i = (int)(b) - 1; i >= (int)(a); --i)

#define all(v) begin(v), end(v)
#define rall(v) rbegin(v), rend(v)

using namespace std;

using ll = long long;

vector<vector<int>> memo;
vector<int> Ask(int n) {
    if (memo[n].empty()) memo[n] = ask(n);
    return memo[n];
}

int find_best(int n) {
    memo.resize(n);
    {
        int ok = 0, ng = n;
        while (ng - ok > 1) {
            int mid = (ok + ng) / 2;
            if (Ask(mid)[0] >= 1) ng = mid;
            else ok = mid;
        }
        return ok;
    }
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 4952 KB Output is correct
2 Correct 2 ms 4952 KB Output is correct
3 Correct 2 ms 4952 KB Output is correct
4 Correct 2 ms 4952 KB Output is correct
5 Correct 2 ms 4952 KB Output is correct
6 Correct 3 ms 4952 KB Output is correct
7 Correct 3 ms 5036 KB Output is correct
8 Correct 3 ms 4952 KB Output is correct
9 Correct 3 ms 4952 KB Output is correct
10 Correct 3 ms 4952 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 4952 KB Output is correct
2 Correct 3 ms 4952 KB Output is correct
3 Correct 2 ms 4952 KB Output is correct
4 Correct 2 ms 4952 KB Output is correct
5 Correct 2 ms 4952 KB Output is correct
6 Correct 2 ms 4952 KB Output is correct
7 Correct 2 ms 4952 KB Output is correct
8 Correct 2 ms 4952 KB Output is correct
9 Correct 2 ms 4952 KB Output is correct
10 Correct 2 ms 4952 KB Output is correct
11 Incorrect 3 ms 4952 KB answer is not correct
12 Halted 0 ms 0 KB -