結果
| 問題 | No.3526 Anti SKG |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-05-04 21:27:48 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 414 bytes |
| 記録 | |
| コンパイル時間 | 287 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 65,920 KB |
| 最終ジャッジ日時 | 2026-05-04 21:27:58 |
| 合計ジャッジ時間 | 4,354 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 1 RE * 1 |
| other | AC * 12 WA * 4 RE * 14 |
ソースコード
s = input()
if len(s) < 3 :
print("YES")
print(s.replace(".", "S"))
exit()
if "SKG" in s :
print("No")
else :
print("Yes")
pre = "."
nxt = "."
for (i, c) in enumerate(s) :
if c != "." :
continue
pre = ("." if i == 0 else s[i-1])
nxt = ("." if i == len(s)-1 else s[i+1])
if pre == "K" or nxt == "K" :
s[i] = "K"
elif pre == "S" and nxt == "G" :
s[i] = "S"
else :
s[i] = "K"
print(s)