結果

問題 No.1534 おなかがいたい
ユーザー titiatitia
提出日時 2021-06-06 18:37:13
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 114 ms / 2,000 ms
コード長 211 bytes
コンパイル時間 621 ms
コンパイル使用メモリ 10,680 KB
実行使用メモリ 8,372 KB
最終ジャッジ日時 2023-08-15 00:48:25
合計ジャッジ時間 2,532 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,932 KB
testcase_01 AC 15 ms
7,784 KB
testcase_02 AC 15 ms
7,832 KB
testcase_03 AC 15 ms
7,828 KB
testcase_04 AC 14 ms
7,920 KB
testcase_05 AC 15 ms
7,800 KB
testcase_06 AC 14 ms
7,880 KB
testcase_07 AC 15 ms
7,880 KB
testcase_08 AC 15 ms
7,744 KB
testcase_09 AC 15 ms
7,796 KB
testcase_10 AC 16 ms
7,900 KB
testcase_11 AC 15 ms
7,768 KB
testcase_12 AC 98 ms
8,312 KB
testcase_13 AC 107 ms
8,372 KB
testcase_14 AC 114 ms
8,308 KB
testcase_15 AC 16 ms
8,292 KB
testcase_16 AC 107 ms
8,272 KB
testcase_17 AC 110 ms
8,312 KB
testcase_18 AC 113 ms
8,292 KB
testcase_19 AC 16 ms
8,324 KB
testcase_20 AC 113 ms
8,264 KB
testcase_21 AC 15 ms
7,852 KB
testcase_22 AC 15 ms
7,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S=input()

pon=0
pain=0

for i in range(len(S)):
    if S[i:i+3]=="pon":
        pon+=1
    if S[i:i+4]=="pain":
        pain=1
        break

if pon<=1 or pain==0:
    print(-1)
else:
    pon-=1
    print(pon)
0