Submission #643601

#TimeUsernameProblemLanguageResultExecution timeMemory
643601keta_tsimakuridzePrisoner Challenge (IOI22_prison)C++17
80 / 100
15 ms980 KiB
#include "prison.h" #include <bits/stdc++.h> using namespace std; #include <vector> std::vector<std::vector<int>> devise_strategy(int N) { vector<vector<int>> v; v.resize(3 * 8 - 1, vector<int> (N + 1)); int x = 2187, t = 1; for(int i = 1; i <= N; i++) { v[0][i] = i / x + 1; } for(int i = 1; i <= 24; i += 3) { // i , i + 1, i + 3 --- eseni aris for(int T = 0; T < 3; T++) { if(i + T > 22) continue; v[i + T][0] = t; for(int j = 1; j <= N; j++) { if(x == 1 || (j % (x * 3)) / x != T) { if(x != 1) v[i + T][j] = ((j % (x * 3)) / x < T ? -t - 1 : -(1 - t) - 1); else v[i + T][j] = (j % 3 == 0 ? -t - 1 : -(1 - t) - 1); } else { if(x > 3 || (x == 3 && ((j % x) / (x / 3)) == 1)) v[i + T][j] = (x > 3 ? i + 3 + ((j % x) / (x / 3)) : 22); else if(x == 3 && ((j % x) / (x / 3)) == 2) v[i + T][j] = -(1 - t) - 1; else if(x == 3 && ((j % x) / (x / 3)) == 0) v[i + T][j] = -t - 1; } } } x /= 3; t ^= 1; } return v; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...