이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#include "paint.h"
//#define int long long
#define pi pair<int, int>
#define pii pair<int, pi>
#define fi first
#define se second
#ifdef _WIN32
#define getchar_unlocked _getchar_nolock
#endif
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
int P[300005], S[300005];
std::string solve_puzzle(std::string s, std::vector<int> c) {
int n = (int)s.length(), k = (int)c.size();
for(int i=1;i<=k;i++)P[i] = P[i-1] + c[i-1] + 1;
S[k+1] = P[0] = 0;
string ans;
for(int i=k;i>=1;i--)S[i] = S[i+1] + c[i-1] + 1;
for(int i=0;i<n;i++){
bool f = 0;
for(int j=0;j<=k;j++)if(P[j] - 1 <= i && S[j+1] - 1 <= (n - i - 1))f = 1;
bool f2 = 0;
int cur = 0;
for(int j=0;j<k;j++){
if(cur < i + 1 && cur + c[j] >= i + 1)f2 = 1;
cur += c[j] + 1;
}
if(P[k] - 1 != n)f2 = 1;
//cout << f << ' ' << f2 << '\n';
if(f && f2)ans += "?";
else if(f)ans += "_";
else ans += "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... |