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;
std::string solve_puzzle(std::string s, std::vector<int> c) {
bitset<200> bt;
int pt =0;
for (auto &x:c) {
for (int i=0;i<x;i++) bt[pt++]=1;
pt++;
}
int n=(int)s.size();
for (int i=0;i<=(n-pt);i++) {
bt &= bt << 1;
}
string out;
for (int i=0;i<n;i++) {
if (bt[i] == 0) out += "?";
else out += "X";
}
if (out.back() == 'X') {
for (auto &x:out) if (x == '?') x='_';
}
return out;
}
# | 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... |