結果
| 問題 | No.3526 Anti SKG |
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2026-05-04 21:28:36 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 148 ms / 2,000 ms |
| コード長 | 464 bytes |
| 記録 | |
| コンパイル時間 | 792 ms |
| コンパイル使用メモリ | 20,696 KB |
| 実行使用メモリ | 16,988 KB |
| 最終ジャッジ日時 | 2026-05-04 21:28:44 |
| 合計ジャッジ時間 | 6,324 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
import sys
input = sys.stdin.readline
T=input().strip()
flag=0
for i in range(len(T)-3):
if T[i]=="S" and T[i+1]=="K" and T[i+2]=="G":
flag=1
if flag==1:
print("No")
else:
print("Yes")
ANS=[]
for s in T:
if s==".":
if len(ANS)>=2 and ANS[-1]=="K" and ANS[-2]=="S":
ANS.append("K")
else:
ANS.append("G")
else:
ANS.append(s)
print("".join(ANS))
titia