結果

問題 No.1534 おなかがいたい
ユーザー keijakkeijak
提出日時 2021-06-06 18:27:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 20 ms / 2,000 ms
コード長 375 bytes
コンパイル時間 209 ms
コンパイル使用メモリ 10,724 KB
実行使用メモリ 8,396 KB
最終ジャッジ日時 2023-08-15 00:39:49
合計ジャッジ時間 1,833 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,804 KB
testcase_01 AC 17 ms
7,784 KB
testcase_02 AC 16 ms
7,908 KB
testcase_03 AC 16 ms
7,816 KB
testcase_04 AC 16 ms
7,756 KB
testcase_05 AC 16 ms
7,784 KB
testcase_06 AC 16 ms
7,988 KB
testcase_07 AC 16 ms
7,916 KB
testcase_08 AC 16 ms
7,884 KB
testcase_09 AC 16 ms
7,888 KB
testcase_10 AC 16 ms
7,804 KB
testcase_11 AC 15 ms
7,796 KB
testcase_12 AC 17 ms
8,396 KB
testcase_13 AC 17 ms
8,296 KB
testcase_14 AC 17 ms
8,272 KB
testcase_15 AC 17 ms
8,332 KB
testcase_16 AC 20 ms
8,316 KB
testcase_17 AC 19 ms
8,328 KB
testcase_18 AC 18 ms
8,272 KB
testcase_19 AC 16 ms
8,332 KB
testcase_20 AC 19 ms
8,292 KB
testcase_21 AC 16 ms
7,836 KB
testcase_22 AC 16 ms
7,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

try:
    import frosch

    frosch.hook()
except ImportError:
    pass


def debug(*a, **kw):
    print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))


def solve():
    S = sys.stdin.readline().rstrip()
    p = S.find("pain")
    if p < 0:
        return -1
    c = S[:p].count("pon")
    if c < 2:
        return -1
    return c - 1


print(solve())
0