結果

問題 No.1534 おなかがいたい
ユーザー 👑 KazunKazun
提出日時 2021-06-06 18:06:14
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 169 bytes
コンパイル時間 1,338 ms
コンパイル使用メモリ 87,212 KB
実行使用メモリ 76,180 KB
最終ジャッジ日時 2023-08-15 00:07:53
合計ジャッジ時間 2,907 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
70,992 KB
testcase_01 AC 70 ms
71,320 KB
testcase_02 AC 68 ms
71,144 KB
testcase_03 AC 70 ms
71,348 KB
testcase_04 AC 70 ms
71,452 KB
testcase_05 AC 70 ms
70,988 KB
testcase_06 AC 70 ms
71,124 KB
testcase_07 AC 71 ms
71,284 KB
testcase_08 AC 71 ms
71,280 KB
testcase_09 AC 72 ms
70,992 KB
testcase_10 AC 71 ms
71,208 KB
testcase_11 AC 71 ms
71,276 KB
testcase_12 AC 76 ms
76,136 KB
testcase_13 AC 71 ms
71,768 KB
testcase_14 AC 71 ms
71,396 KB
testcase_15 AC 69 ms
71,848 KB
testcase_16 AC 78 ms
75,844 KB
testcase_17 AC 78 ms
76,180 KB
testcase_18 AC 80 ms
75,940 KB
testcase_19 AC 71 ms
71,704 KB
testcase_20 AC 78 ms
75,932 KB
testcase_21 AC 70 ms
71,312 KB
testcase_22 AC 70 ms
71,096 KB
権限があれば一括ダウンロードができます

ソースコード

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