이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <vector>
std::vector<std::vector<int>> devise_strategy(int N) {
const int num_prisoners = 500;
std::vector<std::vector<int>> strategy(num_prisoners+1, std::vector<int>(N+1, 0));
for (int i = 1; i <= num_prisoners; ++i) {
if (i <= 250) {
strategy[i][0] = 0; // Inspect bag A.
for (int j = 1; j <= N; ++j) {
if (i == j) {
strategy[i][j] = -1; // Identify bag A as having fewer coins.
} else {
strategy[i][j] = (i % num_prisoners) + 1;
}
}
} else {
strategy[i][0] = 1; // Inspect bag B.
for (int j = 1; j <= N; ++j) {
if (i - 250 == j) {
strategy[i][j] = -2; // Identify bag B as having fewer coins.
} else {
strategy[i][j] = (i % num_prisoners) + 1;
}
}
}
}
return strategy;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |