結果
| 問題 | 
                            No.1534 おなかがいたい
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2021-06-06 18:26:15 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 33 ms / 2,000 ms | 
| コード長 | 238 bytes | 
| コンパイル時間 | 208 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 11,136 KB | 
| 最終ジャッジ日時 | 2024-11-23 02:51:54 | 
| 合計ジャッジ時間 | 1,743 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 19 | 
ソースコード
from sys import stdin
def main():
    input = lambda: stdin.readline()[:-1]
    S = input()
    s = S.split("pain")
    ans = s[0].count("pon") - 1
    if len(s) == 1 or ans < 1:
        print(-1)
    else:
        print(ans)
main()