제출 #1078746

#제출 시각아이디문제언어결과실행 시간메모리
1078746The_Samurai죄수들의 도전 (IOI22_prison)C++17
0 / 100
1 ms348 KiB
#include "prison.h" #include "bits/stdc++.h" using namespace std; std::vector<std::vector<int>> devise_strategy(int n) { int x = 34; vector ans(x + 1, vector(n + 1, 0)); for (int i = 0; i <= x; i++) { if (i % 5 == 0) { ans[i][0] = 0; for (int j = 1; j <= n; j++) { ans[i][j] = i + 1; int k = 13 - (i / 5) * 2; if (j & (1 << k)) ans[i][j] += 2; if (j & (1 << (k - 1))) ans[i][j] += 1; } continue; } ans[i][0] = 1; int a = i % 5 - 1, k = 13 - (i / 5) * 2; for (int j = 1; j <= n; j++) { int b = 0; if (j & (1 << k)) b += 2; if (j & (1 << (k - 1))) b += 1; if (a == b) { ans[i][j] = i - i % 5 + 5; if (ans[i][j] > x) ans[i][j] = 0; continue; } ans[i][j] = (a > b ? -1 : -2); } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...