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 <bits/stdc++.h>
using namespace std;
string solve_puzzle(string s, vector<int> c) {
int n = c.size();
int m = s.size();
vector <int> pos(n);
pos[0] = 0;
for (int i = 1; i < n; i ++) {
pos[i] = pos[i-1] + c[i-1] + 1;
}
int rem = m - pos[n-1] - c[n-1];
for (int i = 0; i < m; i ++) {
if (!rem) s[i] = '_';
else s[i] = '?';
}
for (int i = 0; i < n; i ++) {
for (int j = pos[i] + rem; j < pos[i] + c[i]; j ++) {
s[j] = 'X';
}
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |