제출 #629573

#제출 시각아이디문제언어결과실행 시간메모리
629573somethingnew죄수들의 도전 (IOI22_prison)C++17
10 / 100
11 ms940 KiB
#include <iostream> #include "vector" #include <cassert> #include <cstdio> #include <string> #include <vector> #include "algorithm" #include "numeric" #include "climits" #include "iomanip" #include "bitset" #include "cmath" #include "map" #include "deque" #include "array" #include "set" #define all(x) x.begin(), x.end() using namespace std; vector<array<int, 3>> names; vector<vector<int>> devise_strategy(int N) { names.assign(25, {}); names[0] = {0, 0, 0}; for (int i = 0; i < 24; ++i) { names[i + 1] = {i / 2, i % 2, i / 2 % 2}; } vector<vector<int>> res; res.push_back(vector<int>(N + 1, 0)); res[0][0] = 1; for (int i = 1; i <= N; ++i) { res[0][i] = bitset<13>(i)[12-0] + 1; } int mx = 0; for (int i = 1; i < 25; ++i) { res.push_back(vector<int>(N + 1, 0)); res[i][0] = names[i][2]; for (int j = 1; j <= N; ++j) { bitset<13> bt = j; if (i > 2 and bt[12-names[i][0]] != names[i][1]) { res[i][j] = -(names[i][2] ^ (bt[12-names[i][0]] > names[i][1]))-1; } else { if (12-(names[i][0] + 1) > 0) res[i][j] = bitset<13>(j)[12-(names[i][0] + 1)] + names[i][0] * 2 + 3; else res[i][j] = -(bitset<13>(j)[12-(names[i][0] + 1)] ^ 1)-1; } mx = max(mx, res[i][j]); } } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...