Submission #740543

# Submission time Handle Problem Language Result Execution time Memory
740543 2023-05-12T16:58:19 Z ALVIN Prisoner Challenge (IOI22_prison) C++17
0 / 100
1 ms 288 KB
#include <vector>

std::vector<std::vector<int>> devise_strategy(int N) {
    std::vector<std::vector<int>> s(N + 1, std::vector<int>(N + 1, -2));

    for (int i = 0; i <= N; i++) {
        for (int j = 1; j <= N; j++) {
            if (i == 0) {
                s[i][j] = -2;
            } else if (j == 1) {
                s[i][j] = -1;
            } else if (j > i) {
                s[i][j] = i;
            } else {
                s[i][j] = -2;
            }
        }
        s[i][0] = 0;
    }

    s.push_back(s[0]);
    s.back()[0] = 1;

    return s;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 284 KB Strategy failed for N=2, A=1, B=2
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Strategy failed for N=2, A=1, B=2
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 288 KB Strategy failed for N=3, A=1, B=2
2 Halted 0 ms 0 KB -