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>
#define int long long
using namespace std;
string solve_puzzle(string s, vector<signed> c) {
int n = s.size(), k = c.size();
string ans = "";
int csum = accumulate(c.begin(), c.end(), (int)0);
if(n == csum + k - 1) ans = string(n,'_');
else ans = string(n,'?');
vector<int> l(k),r(k);
int p = 0;
for(int i = 0; i < k; i ++){
l[i] = p + n - (csum + k - 1);
r[i] = p + c[i];
p += c[i] + 1;
}
for(int i = 0; i < k; i ++){
for(int j = l[i]; j < r[i]; j ++) ans[j] = '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... |