이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "paint.h"
#include <bits/stdc++.h>
using namespace std;
#define N 200005
int dp[N], cnt[N], n, t, ok, now;
string st, st1, ans;
string solve_puzzle(string s, vector<int> c) {
n = s.size();
t = c.size();
now = 0;
for (int i = 0;i < n;i++){
if (t == now){
st += '_';
continue;
}
ok = 0;
for (int j = 0;j < c[now];j++)
if (s[i + j] == '_')
ok = 1;
if (!ok) {
int tmp = i + c[now++];
for (;i < tmp;i++)
st1 += 'X';
}
else st = '_';
}
reverse(s.begin(), s.end());
reverse(c.begin(), c.end());
now = 0;
for (int i = 0;i < n;i++){
if (t == now){
st1 += '_';
continue;
}
ok = 0;
for (int j = 0;j < c[now];j++)
if (s[i + j] == '_')
ok = 1;
if (!ok) {
int tmp = i + c[now++];
for (;i < tmp;i++)
st1 += 'X';
}
else st1 = '_';
}
reverse(st1.begin(), st1.end());
for (int i = 0;i < n;i++)
if (st[i] == st1[i]) ans += st[i];
else ans += '?';
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... |