제출 #774158

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