Submission #618009

#TimeUsernameProblemLanguageResultExecution timeMemory
618009A_DPaint By Numbers (IOI16_paint)C++14
Compilation error
0 ms0 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++){ if(ss[i-1]!='X')dp[i][0]=1; 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; }

Compilation message (stderr)

paint.cpp:74:2: error: extended character   is not valid in an identifier
   74 |     }
      |  ^
paint.cpp: In function 'std::string solve_puzzle(std::string, std::vector<int>)':
paint.cpp:74:2: error: '\U000000a0' was not declared in this scope
   74 |     }
      |  ^