Submission #1037485

#TimeUsernameProblemLanguageResultExecution timeMemory
1037485HappyCapybaraPrisoner Challenge (IOI22_prison)C++17
0 / 100
9 ms1212 KiB
#include "prison.h" #include <bits/stdc++.h> using namespace std; vector<vector<int>> devise_strategy(int N){ if (N == 2) return {{0, 1, 2}, {1, 0, -1}, {1, -2, 0}}; int y = ceil(log2(N)); vector<vector<int>> a(3*y, vector<int>(N+1)); for (int i=0; i<3*y; i++){ for (int j=0; j<N+1; j++){ if (i % 3 == 0){ if (j == 0){ a[i][j] = 0; continue; } a[i][j] = i+1+min(1, (j&(1<<(y-1-i/3)))); } else { if (j == 0){ a[i][j] = 1; continue; } int b = 1+min(1, j&(1<<(y-1-i/3))); if (b == i % 3) a[i][j] = (i+(3-i%3))%(3*y); else { if (b > i % 3) a[i][j] = -1; else a[i][j] = -2; } } } } return a; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...