結果

問題 No.1534 おなかがいたい
ユーザー 👑 Kazun
提出日時 2021-06-06 18:06:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 50 ms / 2,000 ms
コード長 169 bytes
コンパイル時間 202 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 59,264 KB
最終ジャッジ日時 2024-11-23 01:56:13
合計ジャッジ時間 2,203 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

S=input()

if "pain" not in S:
    exit(print(-1))

x=S.index("pain")
T=S[:x+4]

m=0
for i in range(x):
    if T[i:i+3]=="pon":
        m+=1

print(m-1 if m>=2 else -1)
0