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;
const int MAX_N = 2e5 + 5;
int qs[MAX_N];
string ans;
string solve_puzzle(string s, vector <int> c) {
int N = s.size(), k = c.size();
for (int i = 0; i < N; i++) ans.push_back('?');
for (int i = 1; i <= k; i++) qs[i] = qs[i - 1] + c[i - 1];
for (int i = 1; i <= k; i++) {
int l = qs[i - 1] + i;
int r = N - (qs[k] - qs[i]) - (k - i);
for (int j = r - c[i - 1] + 1; j <= l + c[i - 1] - 1; j++) ans[j - 1] = 'X';
}
return ans;
}
# | 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... |