# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
667071 | tatyam | Prisoner Challenge (IOI22_prison) | C++17 | 11 ms | 980 KiB |
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 <bits/stdc++.h>
using namespace std;
vector<vector<int>> devise_strategy(int N) {
vector<vector<int>> A(21, vector<int>(N + 1));
vector<vector<int>> idx = {
{0},
{1, 2, 3},
{4, 5, 6},
{7, 8, 9},
{10, 11, 12},
{13, 14, 15},
{16, 17, 18},
{19, 20}
};
for(int k = 0; k < idx.size(); k++) for(int i : idx[k]) A[i][0] = k % 2;
auto f = [&](int k, int i, int L, int R, auto f){
if(R - L <= 1) return;
A[i][L] = k % 2 ? -2 : -1;
A[i][R - 1] = k % 2 ? -1 : -2;
if(R - L == 2) return;
for(int i : idx[k + 1]) {
A[i][L] = k % 2 ? -1 : -2;
A[i][R - 1] = k % 2 ? -2 : -1;
}
L++; R--;
const int W = R - L, D = idx[k + 1].size();
vector<int> block;
for(int b = 0; b <= D; b++) block.push_back(L + W * b / D);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |