結果

問題 No.1534 おなかがいたい
ユーザー gorugo30gorugo30
提出日時 2021-06-06 18:02:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 148 bytes
コンパイル時間 428 ms
コンパイル使用メモリ 87,020 KB
実行使用メモリ 72,036 KB
最終ジャッジ日時 2023-08-15 00:03:27
合計ジャッジ時間 3,439 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,380 KB
testcase_01 AC 76 ms
71,140 KB
testcase_02 AC 68 ms
71,296 KB
testcase_03 AC 70 ms
70,972 KB
testcase_04 AC 71 ms
71,312 KB
testcase_05 AC 70 ms
71,132 KB
testcase_06 AC 70 ms
71,252 KB
testcase_07 AC 70 ms
71,092 KB
testcase_08 AC 69 ms
71,016 KB
testcase_09 AC 71 ms
71,128 KB
testcase_10 AC 69 ms
71,248 KB
testcase_11 AC 71 ms
71,384 KB
testcase_12 AC 72 ms
71,844 KB
testcase_13 AC 72 ms
71,336 KB
testcase_14 AC 73 ms
71,492 KB
testcase_15 AC 72 ms
71,752 KB
testcase_16 AC 73 ms
71,984 KB
testcase_17 AC 74 ms
72,036 KB
testcase_18 AC 76 ms
71,840 KB
testcase_19 AC 73 ms
71,580 KB
testcase_20 AC 76 ms
71,856 KB
testcase_21 AC 71 ms
71,140 KB
testcase_22 AC 72 ms
71,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

i = S.index("pain")
c = S[:i].count("pon")

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