# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
433104 | Monchito | Paint By Numbers (IOI16_paint) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "paint.h"
#include <cstdlib>
using namespace std;
string solve_puzzle(string s, vector<int> c) {
int n = (int)s.size();
int k = (int)c.size();
string ret="";
for(int i=0; i<n; i++) ret += "?";
int current=0;
for(int i=0; i<k; i++) {
for(int j=current; j<current+c[i]; j++) {
ret[j] = 'X';
}
if(current+c[i] < n) ret[current+c[i]] = '_';
current += c[i]+1;
}
int l=0;
for(int i=current; i<n; i++) {
ret[l] = '?';
l++;
}