제출 #793025

#제출 시각아이디문제언어결과실행 시간메모리
793025ShithilaPaint By Numbers (IOI16_paint)C++14
32 / 100
1 ms308 KiB
#include "paint.h" #include <cstdlib> #include <vector> #include <iostream> #include <algorithm> using namespace std; std::string solve_puzzle(std::string s, std::vector<int> c) { int n=s.length(); int m=c.size(); int val=0; for(int i=0;i<m;i++) { val=val+c[i]+1; } val=val-1; string arr[n-val+1]; for(int i=0;i<n-val+1;i++) { arr[i]=s; for(int j=0;j<n;j++) { arr[i][j]='_'; } } for(int i=0;i<n-val+1;i++) { int pos=i; int j=0; while(j<m) { for(int k=0;k<c[j];k++) { arr[i][pos]='X'; pos++; } j++; if(j!=m) { pos++; } } } for(int j=0;j<n;j++) { bool chek=true; for(int i=0;i<n-val+1;i++) { if(arr[0][j]!=arr[i][j]) chek=false; } if(chek==true) { s[j]=arr[0][j]; } else { s[j]='?'; } } return s; }
#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...