제출 #1073312

#제출 시각아이디문제언어결과실행 시간메모리
1073312fv3죄수들의 도전 (IOI22_prison)C++17
41 / 100
17 ms1628 KiB
#include "prison.h" #include <bits/stdc++.h> using namespace std; vector<vector<int>> devise_strategy(int N) { vector<vector<int>> p(13 * 3 - 2, vector<int>(N+1, 1)); int bit = 13; for (int i = 0; i < 13 * 3 - 2; i++) { if (i % 3 == 0) { p[i][0] = 0; bit--; for (int j = 1; j <= N; j++) { if (j & (1 << bit)) p[i][j] = i + 2; else p[i][j] = i + 1; } } else if (i % 3 == 1) { for (int j = 1; j <= N; j++) { if (j & (1 << bit)) p[i][j] = -1; else p[i][j] = i + 2; } } else { for (int j = 1; j <= N; j++) { if (j & (1 << bit)) p[i][j] = i + 1; else p[i][j] = -2; } } } for (int i = 1; i <= N; i++) { if (p.back()[i] == 37) p.back()[i] = -1; else p.back()[i] = -2; } return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...