結果

問題 No.1534 おなかがいたい
ユーザー Takuya Noguchi
提出日時 2021-07-06 22:27:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 214 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 82,028 KB
実行使用メモリ 54,632 KB
最終ジャッジ日時 2024-07-01 12:16:29
合計ジャッジ時間 2,071 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input().rstrip()
pain_index = S.find('pain')
if pain_index == -1:
    print(-1)
else:
    pon_count = S[0:pain_index].count('pon')

    if pon_count < 2:
        print(-1)
    else:
        print(pon_count - 1)
0