제출 #617909

#제출 시각아이디문제언어결과실행 시간메모리
617909A_DPaint By Numbers (IOI16_paint)C++14
0 / 100
0 ms212 KiB
#include "paint.h" #include <bits/stdc++.h> using namespace std; const int N=1e2+10; int dp[N][N]; string ss; vector<int> cc; int n,k,m; string tr; int okx(int u) { dp[0][0]=1; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ dp[i][j]=0; if((ss[i-1]!='X'&&tr[j-1]!='X')||(i==1&&ss[0]!='X')){ dp[i][j]|=dp[i-1][j]; } if(ss[i-1]!='_'&&tr[j-1]=='X'){ dp[i][j]|=dp[i-1][j-1]; } if(ss[i-1]!='X'&&tr[j-1]=='_'){ dp[i][j]|=dp[i-1][j-1]; } } } return dp[n][m]; } string solve_puzzle(string s,vector<int> c){ string ans=s; cc=c; ss=s; n=s.size(); k=c.size(); for(int i=0;i<k;i++){ for(int j=0;j<c[i];j++){ tr+='X'; } tr+='_'; } m=tr.size(); for(int i=0;i<n;i++){ if(s[i]!='.')continue; int ok=0; ss[i]='X'; ok+=okx(i); ss[i]='_'; ok+=2*okx(i); ss[i]='.'; if(ok==1)ans[i]='X'; if(ok==2)ans[i]='_'; if(ok==3)ans[i]='?'; cout<<n<<" "<<m<<"\n"; for(int h=1;h<=n;h++){ for(int j=1;j<=m;j++){ cout<<dp[h][j]<<" "; } cout<<"\n"; } return ans; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...