제출 #729725

#제출 시각아이디문제언어결과실행 시간메모리
729725Nahian9696죄수들의 도전 (IOI22_prison)C++17
48.50 / 100
23 ms1368 KiB
#include "prison.h" #include <vector> #include <bits/stdc++.h> using namespace std; #define f0(i, n) for(int i = 0; i < (n); i++) #define f1(i, n) for(int i = 1; i <= (n); i++) #define pb push_back #define ff first #define ss second typedef vector<int> vi; std::vector<std::vector<int>> devise_strategy(int N) { int x = 32; vi init(N+1, 0); std::vector<std::vector<int>> s(x, init); f0(i, 32) { int dig = i / 4; if(i % 4 == 0) { s[i][0] = 0; f1(j, N) { int d = 7 - dig, nn = j; while (d--) nn /= 3; s[i][j] = (i + (nn % 3) + 1); // cout << s[i][j] << " "; } // cout << endl; } else { s[i][0] = 1; f1(j, N) { int d = 7 - dig, nn = j; while (d--) nn /= 3; if( ((nn % 3) + 1) > ((i % 4)) ) { s[i][j] = -1; } else if( ((nn % 3) + 1) < ((i % 4)) ) { s[i][j] = -2; } else { s[i][j] = ((dig + 1)*4) % 32; } // cout << s[i][j] << " "; } // cout << endl; } } return s; return {std::vector<int>(N + 1, 0)}; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...