Submission #1074524

#TimeUsernameProblemLanguageResultExecution timeMemory
1074524zsomborPrisoner Challenge (IOI22_prison)C++17
38 / 100
16 ms2396 KiB
#include "prison.h" #include <bits/stdc++.h> using namespace std; int n; vector<vector<int> > v(39); void solve0(int i) { int x = 12 - (i / 3); v[i][0] = 0; for (int j = 1; j <= n; j++) v[i][j] = i + 1 + ((j >> x) & 1); } void solve1(int i) { int x = 12 - (i / 3); v[i][0] = 1; int nxt = (i + 2 < 39 ? i + 2 : 0); for (int j = 1; j <= n; j++) v[i][j] = ((j >> x) & 1 ? -1 : nxt); } void solve2(int i) { int x = 12 - (i / 3); v[i][0] = 1; int nxt = (i + 1 < 39 ? i + 1 : 0); for (int j = 1; j <= n; j++) v[i][j] = ((j >> x) & 1 ? nxt : -2); } vector<vector<int> > devise_strategy(int N) { n = N; for (int i = 0; i < 39; i++) { v[i].assign(n + 1, 0); if (i % 3 == 0) solve0(i); if (i % 3 == 1) solve1(i); if (i % 3 == 2) solve2(i); } return v; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...