제출 #774206

#제출 시각아이디문제언어결과실행 시간메모리
774206jasmin죄수들의 도전 (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(L*3, vector<int> (n+1, 0)); for(int x=0; x<L*3; x++){ if(x%3==0){//look at A ans[x][0]=0; int l=L-(x/3); for(int a=1; a<=n; a++){ if((a>>l)%2==0){ ans[x][a]=x+1; } else{ ans[x][a]=x+2; } } } else{ //look at B ans[x][0]=1; int bita=x%3-1; int l=L-(x/3); for(int b=1; b<=n; b++){ int bitb = (b>>l)%2; if(bita<bitb){ ans[x][b]=-1; } else if(bita>bitb){ ans[x][b]=-2; } else{ ans[x][b] = (x/3 +1)*3; if(ans[x][b]>=L*3){ ans[x][b]=0; } } } } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...