結果

問題 No.1534 おなかがいたい
ユーザー トミートミー
提出日時 2024-04-13 17:30:35
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 355 bytes
コンパイル時間 506 ms
コンパイル使用メモリ 82,264 KB
実行使用メモリ 64,496 KB
最終ジャッジ日時 2024-04-13 17:30:40
合計ジャッジ時間 4,963 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
60,304 KB
testcase_01 AC 37 ms
52,736 KB
testcase_02 AC 37 ms
52,900 KB
testcase_03 AC 36 ms
53,248 KB
testcase_04 AC 37 ms
53,540 KB
testcase_05 AC 37 ms
52,340 KB
testcase_06 AC 40 ms
53,188 KB
testcase_07 AC 36 ms
52,928 KB
testcase_08 AC 38 ms
52,376 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    s=input()
    if s.find("pain")==-1:
        print(-1)
        exit()
    cnt=0
    while True:
        if s[0:3]=="pon":
            s=s[3:]
            cnt+=1
        else:
            s=s[1:]
        if s[0:4]=="pain":
            break
    result = -1 if cnt<2 else cnt-1
    print(result)
    


if __name__ == "__main__":
    main()
0