Submission #626796

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6267962022-08-11 19:29:36flashmtPrisoner Challenge (IOI22_prison)C++17
0 / 100
1 ms212 KiB
#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> devise_strategy(int n) {
vector<vector<int>> ans(21, vector<int>(n + 1, -1));
for (int i = 0; i <= 20; i++)
ans[i][0] = 0;
function<void(int, int, int, int)> solve = [&](int turn, int row, int low, int high)
{
int curBag = turn % 2, otherBag = curBag ^ 1;
ans[row][0] = curBag;
ans[row][low++] = -curBag - 1;
if (high > low)
ans[row][--high] = -otherBag - 1;
int rem = high - low;
if (rem <= 1)
return;
vector<int> nextRows;
if (rem <= 4) // divide into block of size 2
{
for (int i = 0; i < rem; i++)
ans[row][low + i] = turn * 3 + i / 2 + 1;
solve(turn + 1, turn * 3 + 1, low, min(low + 2, high));
nextRows.push_back(turn * 3 + 1);
if (rem > 2)
{
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...