問題一覧 > 通常問題

No.3526 Anti SKG

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 1024 MB / スペシャルジャッジ問題 (複数の解が存在する可能性があります)
タグ : (AC するまで非表示) / 解いたユーザー数 54
作問者 : yu23578 / テスター : GaLLium yt142857 aa36 Yoyoyo8128
お気に入りにしたユーザー ProblemId : 13359 / 自分の提出
問題文最終更新日: 2026-05-04 21:12:45
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Show the original
聖光学院プログラミングコンテスト2026 day2 (順位表) の他の問題:

Problem Statement

You are given a string $T$ consisting of S,K,G,..
Determine whether there exists a string obtained by replacing every . in the string $T$ with one of S,K,G that satisfies the following condition, and if one exists, construct one.
  • SKG is not a (contiguous) substring of $T$.

Constraints

  • The length of $T$ is at least $1$ and at most $2 \times 10^5$.
  • $T$ is a string consisting of S,K,G,..

Input

$T$

Output

If no such string exists, print No on one line. If one exists, print Yes on the first line, and then print a string satisfying the condition on the second line.

Sample

Sample 1
Input
S.K.G
Output
Yes
SKKSG
SKKSG is a string obtained by replacing each . in S.K.G with one of S,K,G, and it does not contain SKG as a substring, so it satisfies the condition.
Sample 2
Input
SSSSSKGKKKSKGSKG.............................................
Output
No

Sample 3
Input
S
Output
Yes
S

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。