제출 #626731

#제출 시각아이디문제언어결과실행 시간메모리
626731coloboxx죄수들의 도전 (IOI22_prison)C++17
56 / 100
13 ms1208 KiB
#include "prison.h" #include <bits/stdc++.h> using namespace std; bool has(int x, int bit) { return (x >> bit) & 1; } vector<vector<int>> devise_strategy(int N) { vector<vector<int>> s(27, vector<int>(N + 1)); s[0][0] = 0; for (int j = 1; j <= N; ++j) s[0][j] = 13 * (has(j, 12) + 1); for (int i = 1; i <= 26; ++i) { int u = (i > 13), bit = i - u * 13 - 1; s[i][0] = (bit + 1) & 1; for (int j = 1; j <= N; ++j) { int v = has(j, bit); if (u != v) s[i][j] = -2 + (u ? s[i][0] ^ 1 : s[i][0]); else { s[i][j] = has(j, bit - 1) * 13 + bit; } } } /*for (auto it : s) { for (auto it2 : it) cout << it2 << ' '; cout << '\n'; }*/ return s; } //3 //1 2 //1 3 //2 1 //2 3 //3 1 //3 2 //-1
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...