제출 #836743

#제출 시각아이디문제언어결과실행 시간메모리
836743Abrar_Al_SamitPrisoner Challenge (IOI22_prison)C++17
0 / 100
1 ms296 KiB
#include "prison.h" #include <bits/stdc++.h> using namespace std; vector<vector<int>> devise_strategy(int N) { vector<vector<int>>s(19, vector<int>(N+1)); s[0][0] = 0; //p 0 bag A for(int j=1; j<=N; ++j) { if(j >> 8 & 1) { s[0][j] = 2; } else { s[0][j] = 1; } } for(int i=1; i<19; ++i) { int cbit = 9 - (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 + 2 + (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 + 2 + (j >> (cbit-1) & 1); } else { s[i][j] = -1; } } } } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...