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 = s.size(), len = c.size() - 1;
string ss;
for(int a:c)
len += a;
string ans, fst;
int i = 0;
while(i < n - len + 1)
{
string temp = string(n, '_');
int cur = i, cnt = 0;
while(cnt < (int)c.size())
{
for(int j=0;j<c[cnt];j++)
temp[cur] = 'X', cur++;
cnt++;
cur++;
}
if(i == 0)
{
ans = temp;
fst = temp;
}
for(int j=0;j<n;j++)
if(fst[j] != temp[j])
ans[j] = '?';
i++;
}
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... |