제출 #774130

#제출 시각아이디문제언어결과실행 시간메모리
774130jasmin죄수들의 도전 (IOI22_prison)C++17
0 / 100
1 ms296 KiB
#include "prison.h" #include<bits/stdc++.h> using namespace std; const int L=13; std::vector<std::vector<int>> devise_strategy(int n) { vector<vector<int> > ans(n+1, vector<int> (n+1, -1)); for(int a=0; a<=n; a++){ if(a&(1<<L)){ ans[0][a]=2; } else{ ans[0][a]=1; } } for(int x=1; x<=n; x++){ int i=L-(x-1)/4; int bit=(x-1)%2; if(x%4<=2){ // from A => look at B now ans[x][0]=1; for(int b=1; b<=n; b++){ int mom=b&(1<<i); if(bit==0 && mom==1){ ans[x][b]=-1; } else if(bit==1 && mom==0){ ans[x][b]=-2; } else{ ans[x][b] = (L-i +1)*4 + 1; if(mom==1) ans[x][b]++; } } } else{ //from B, look at A now ans[x][0]=0; for(int a=1; a<=n; a++){ int mom = a&(1<<i); ans[x][a] = (L-i)*4 + 1; if(mom==1) ans[x][a]++; } } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...