結果
| 問題 | 
                            No.1534 おなかがいたい
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2023-08-01 16:20:58 | 
| 言語 | F#  (F# 4.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 358 ms / 2,000 ms | 
| コード長 | 286 bytes | 
| コンパイル時間 | 7,919 ms | 
| コンパイル使用メモリ | 185,172 KB | 
| 実行使用メモリ | 49,244 KB | 
| 最終ジャッジ日時 | 2024-10-11 07:47:17 | 
| 合計ジャッジ時間 | 15,600 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 19 | 
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (248 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
let s = stdin.ReadLine ()
let mutable pon_count = 0
for i in 0..s.Length-1 do
    if s.[i..i+3] = "pain" then
        printfn "%d" (if pon_count < 2 then -1 else pon_count - 1)
        exit 0
    elif s.[i..i+2] = "pon" then
        pon_count <- pon_count + 1
            
printfn "-1"