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;
typedef long long ll;
string solve_puzzle(string s, vector<int> c) {
ll n = s.size(), k = c.size();
ll minLen = k-1;
for (auto &e : c) minLen += e;
if (minLen == n) {
string res = "";
for (int i = 0; i < k; i++) {
for (int j = 0; j < c[i]; j++) {
res += 'X';
}
if (i < k-1) res += '_';
}
return res;
}
ll play = n - minLen;
ll pos = 0;
for (int i = 0; i < k; i++) {
for (int j = pos+play; j < pos+c[i]; j++) {
s[j] = 'X';
}
pos += c[i]+1;
}
for (auto &e : s) {
if (e == '.') e = '?';
}
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... |