結果

問題 No.1534 おなかがいたい
ユーザー Takuya NoguchiTakuya Noguchi
提出日時 2021-07-06 22:27:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 67 ms / 2,000 ms
コード長 214 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 87,296 KB
実行使用メモリ 72,212 KB
最終ジャッジ日時 2023-09-14 04:32:29
合計ジャッジ時間 3,242 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
71,368 KB
testcase_01 AC 63 ms
71,152 KB
testcase_02 AC 64 ms
71,252 KB
testcase_03 AC 63 ms
71,460 KB
testcase_04 AC 65 ms
71,152 KB
testcase_05 AC 67 ms
71,480 KB
testcase_06 AC 60 ms
71,256 KB
testcase_07 AC 64 ms
71,296 KB
testcase_08 AC 60 ms
71,152 KB
testcase_09 AC 60 ms
71,460 KB
testcase_10 AC 63 ms
71,576 KB
testcase_11 AC 63 ms
71,404 KB
testcase_12 AC 67 ms
72,212 KB
testcase_13 AC 65 ms
71,768 KB
testcase_14 AC 65 ms
71,808 KB
testcase_15 AC 63 ms
71,868 KB
testcase_16 AC 66 ms
71,828 KB
testcase_17 AC 64 ms
72,012 KB
testcase_18 AC 62 ms
72,160 KB
testcase_19 AC 62 ms
71,560 KB
testcase_20 AC 64 ms
71,940 KB
testcase_21 AC 62 ms
71,364 KB
testcase_22 AC 59 ms
71,256 KB
権限があれば一括ダウンロードができます

ソースコード

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