This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "prison.h"
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
vvi devise_strategy(int N) {
vvi report(39, vi(N + 1));
for (int i = 0; i < 13; i++) {
report[3 * i][0] = 0;
report[3 * i + 1][0] = report[3 * i + 2][0] = 1;
for (int j = 1; j <= N; j++) {
int total = (j & (1 << (12 - i))) > 0;
report[3 * i][j] = total + 3 * i + 1;
report[3 * i + 1][j] = total == 0 ? 3 * (i + 1) : total > 0 ? -1 : -2;
report[3 * i + 2][j] = total == 1 ? 3 * (i + 1) : total < 1 ? -2 : -1;
}
}
return report;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |