제출 #836750

#제출 시각아이디문제언어결과실행 시간메모리
836750Abrar_Al_Samit죄수들의 도전 (IOI22_prison)C++17
56 / 100
11 ms1108 KiB
#include "prison.h" #include <bits/stdc++.h> using namespace std; vector<vector<int>> devise_strategy(int N) { vector<vector<int>>s(27, vector<int>(N+1)); s[0][0] = 0; //p 0 bag A for(int j=1; j<=N; ++j) { if(j >> 12 & 1) { s[0][j] = 2; } else { s[0][j] = 1; } } for(int i=1; i<27; ++i) { int cbit = 13 - (i + 1) / 2; if(i & 1) { //off if(i % 4 == 1) { //A s[i][0] = 1; for(int j=1; j<=N; ++j) { if(j >> cbit & 1) { s[i][j] = -1; } else { s[i][j] = i + 2 + (j >> (cbit-1) & 1); } } } else { //B s[i][0] = 0; for(int j=1; j<=N; ++j) { if(j >> cbit & 1) { s[i][j] = -2; } else { s[i][j] = i + 2 + (j >> (cbit-1) & 1); } } } } else { //on if(i % 4 == 2) { //A s[i][0] = 1; for(int j=1; j<=N; ++j) { if(j >> cbit & 1) { s[i][j] = i + 1 + (j >> (cbit-1) & 1); } else { s[i][j] = -2; } } } else { //B s[i][0] = 0; for(int j=1; j<=N; ++j) { if(j >> cbit & 1) { s[i][j] = i + 1 + (j >> (cbit-1) & 1); } else { s[i][j] = -1; } } } } } for(int i=0; i<27; ++i) { for(int j=0; j<=N; ++j) { if(s[i][j]>26) s[i][j] = 0; } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...