제출 #729913

#제출 시각아이디문제언어결과실행 시간메모리
729913caganyanmaz죄수들의 도전 (IOI22_prison)C++17
0 / 100
1 ms212 KiB
#include <bits/stdc++.h> using namespace std; constexpr static int LIM = 30; vector<vector<int>> res; void evaluate_a(int a, int b, int n) { res[b][0] = 0; int shft = 2 * (a / 5 - 2); for (int i = 1; i <= n; i++) { int oo = (i >> shft) & 3; res[b][i] = a - 10 + oo + 1; } } void evaluate_b(int a, int n) { res[a][0] = 1; int shft = 2 * (a / 5); for (int i = 1; i <= n; i++) { int oo = (i >> shft) & 3; if (oo + 1 > (a % 5)) res[a][i] = -2; else if (oo + 1 < (a % 5)) res[a][i] = -1; else res[a][i] = 5 * (1 + a / 5); } } void evaluate(int a, int n) { if (a % 5) evaluate_b(a, n); else evaluate_a(a, a, n); } vector<vector<int>> devise_strategy(int n) { res = vector<vector<int>>(LIM + 1, vector<int>(n+1)); evaluate_a(35, 0, n); for (int i = 1; i <= LIM; i++) evaluate(i, n); return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...