제출 #1081540

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