제출 #1055012

#제출 시각아이디문제언어결과실행 시간메모리
1055012Malix죄수들의 도전 (IOI22_prison)C++17
10 / 100
180 ms1408 KiB
#include "prison.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vii; typedef pair<int,int> pi; typedef vector<pi> pii; typedef tuple<int,int,int> tii; typedef vector<ll> li; typedef vector<li> lii; #define REP(i,a,b) for(int i=a;i<b;i++) #define F first #define S second #define PB push_back #define MP make_pair #define LSOne(s) ((s)&(-s)) ll INF=1e18+10; int inf=1e9+10; ll M=1e9+7; std::vector<std::vector<int>> devise_strategy(int n) { int m=24; vii ans(m+1,vi(n+1)); REP(i,0,m+1){ if(((i+1)/2)%2==1)ans[i][0]=1; else ans[i][0]=0; } REP(j,1,n+1){ if(j&(1<<11))ans[0][j]=1; else ans[0][j]=2; } REP(i,1,m+1){ if(i%2==1){ REP(j,1,n+1){ if(j&(1<<(12-(i+1)/2))){ if((1<<(12-(i+1)/2-1))<0){ ans[i][j]=m;continue; } if(j&(1<<(12-(i+1)/2-1)))ans[i][j]=i+2; else ans[i][j]=i+3; } else { if(((i+1)/2)%2==1)ans[i][j]=-2; else ans[i][j]=-1; } } } else{ REP(j,1,n+1){ if(!(j&(1<<(12-(i+1)/2)))){ if((1<<(12-(i+1)/2-1))<0){ ans[i][j]=m;continue; } if(j&(1<<(12-(i+1)/2-1)))ans[i][j]=i+1; else ans[i][j]=i+2; } else { if(((i+1)/2)%2==1)ans[i][j]=-1; else ans[i][j]=-2; } } } } REP(i,0,m+1)REP(j,0,n+1)if(ans[i][j]>m)ans[i][j]=m; REP(i,0,m+1){ cerr<<i<<" - "; REP(j,0,n+1)cerr<<ans[i][j]<<" "; cerr<<"\n"; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...