제출 #652666

#제출 시각아이디문제언어결과실행 시간메모리
652666Blagoj죄수들의 도전 (IOI22_prison)C++17
56 / 100
16 ms1324 KiB
#include "prison.h" #include <bits/stdc++.h> using namespace std; std::vector<std::vector<int>> devise_strategy(int N) { vector<vector<int>> v(27); for (int i = 0; i < 27; i++) { if (i == 0) { v[i].push_back(0); for (int j = 1; j <= N; j++) { int v1 = 0; if (j & (1 << 12)) { v1 = 1; } v[i].push_back(1 + v1); } continue; } if (i <= 2) { v[i].push_back(1); for (int j = 1; j <= N; j++) { int v1 = 0, v2 = 0; if (i == 2) { v1 = 1; } if (j & (1 << 12)) { v2 = 1; } if (v1 == v2) { v2 = 0; if (j & (1 << 11)) { v2 = 1; } v[i].push_back(3 + v2); } else { if (v1 > v2) { v[i].push_back(-2); } else { v[i].push_back(-1); } } } continue; } int k = i; if (i % 2 == 0) { k--; } if ((k / 2) % 2 == 0) { v[i].push_back(1); for (int j = 1; j <= N; j++) { int v1 = i - k, v2 = 0; if (j & (1 << (12 - (k / 2)))) { v2 = 1; } if (v1 == v2) { v2 = 0; if (j & (1 << (12 - (k / 2 + 1)))) { v2 = 1; } v[i].push_back(min(k + 2 + v2, 26)); } else { if (v1 > v2) { v[i].push_back(-2); } else { v[i].push_back(-1); } } } } else { v[i].push_back(0); for (int j = 1; j <= N; j++) { int v1 = i - k, v2 = 0; if (j & (1 << (12 - (k / 2)))) { v2 = 1; } if (v1 == v2) { v2 = 0; if (j & (1 << (12 - (k / 2 + 1)))) { v2 = 1; } v[i].push_back(min(k + 2 + v2, 26)); } else { if (v1 < v2) { v[i].push_back(-2); } else { v[i].push_back(-1); } } } } } return v; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...