結果

問題 No.1534 おなかがいたい
ユーザー TnaTna
提出日時 2022-07-08 13:16:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 255 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 10,748 KB
実行使用メモリ 9,688 KB
最終ジャッジ日時 2023-08-27 06:29:09
合計ジャッジ時間 1,834 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
9,016 KB
testcase_01 AC 24 ms
8,884 KB
testcase_02 AC 22 ms
9,028 KB
testcase_03 AC 23 ms
9,044 KB
testcase_04 AC 24 ms
9,032 KB
testcase_05 AC 23 ms
8,832 KB
testcase_06 AC 22 ms
9,048 KB
testcase_07 AC 22 ms
9,036 KB
testcase_08 AC 23 ms
9,032 KB
testcase_09 AC 23 ms
8,976 KB
testcase_10 AC 24 ms
9,024 KB
testcase_11 AC 23 ms
8,888 KB
testcase_12 AC 24 ms
9,204 KB
testcase_13 AC 28 ms
9,364 KB
testcase_14 AC 23 ms
9,356 KB
testcase_15 AC 24 ms
9,280 KB
testcase_16 AC 28 ms
9,604 KB
testcase_17 AC 27 ms
9,688 KB
testcase_18 AC 27 ms
9,624 KB
testcase_19 AC 23 ms
9,352 KB
testcase_20 AC 25 ms
9,356 KB
testcase_21 AC 22 ms
9,032 KB
testcase_22 AC 21 ms
8,884 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import re
import sys

S = input()
if  "pain" not in S:
    print(-1)
    sys.exit()
S = S.split("pain")
# print(S)
results = re.findall(r"pon", S[0])
if len(results) >= 2:
    print(len(results)-1)
elif len(results) == 1:
    print(-1)
else:
    print(-1)
0