結果
| 問題 | No.3526 Anti SKG |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-05-04 21:29:22 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 87 ms / 2,000 ms |
| コード長 | 445 bytes |
| 記録 | |
| コンパイル時間 | 152 ms |
| コンパイル使用メモリ | 85,008 KB |
| 実行使用メモリ | 83,900 KB |
| 最終ジャッジ日時 | 2026-05-04 21:29:26 |
| 合計ジャッジ時間 | 3,987 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
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 != "." :
print(c, end="")
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" :
c = "K"
elif pre == "S" and nxt == "G" :
c = "S"
else :
c = "K"
print(c, end="")
print("")