# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1065667 | sunboi | Paint By Numbers (IOI16_paint) | C++17 | 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 <bits/stdc++.h>
#include "paint.h"
using namespace std;
string solve_puzzle(string s, int[] c){
int n = s.size();
int k = c.size();
int r = min(c[0] - 1, n - 1);
int l = max(0, n - 1 - (c[0] - 1));
for (int i = 0; i< n; i++){
if (i >= l && i <= r){
s[i] = 'X';
}else s[i] = '?';
}
return s;
}