結果

問題 No.1534 おなかがいたい
ユーザー natoriusannatoriusan
提出日時 2023-08-01 16:20:58
言語 F#
(F# 4.0)
結果
AC  
実行時間 320 ms / 2,000 ms
コード長 286 bytes
コンパイル時間 6,533 ms
コンパイル使用メモリ 183,628 KB
実行使用メモリ 49,104 KB
最終ジャッジ日時 2024-04-19 15:39:41
合計ジャッジ時間 13,402 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 299 ms
33,920 KB
testcase_01 AC 295 ms
33,480 KB
testcase_02 AC 53 ms
29,952 KB
testcase_03 AC 298 ms
34,212 KB
testcase_04 AC 298 ms
34,196 KB
testcase_05 AC 291 ms
33,472 KB
testcase_06 AC 51 ms
30,208 KB
testcase_07 AC 295 ms
34,320 KB
testcase_08 AC 300 ms
34,064 KB
testcase_09 AC 305 ms
34,192 KB
testcase_10 AC 50 ms
30,080 KB
testcase_11 AC 294 ms
34,500 KB
testcase_12 AC 314 ms
47,720 KB
testcase_13 AC 70 ms
44,508 KB
testcase_14 AC 71 ms
44,792 KB
testcase_15 AC 297 ms
35,904 KB
testcase_16 AC 320 ms
48,948 KB
testcase_17 AC 312 ms
48,984 KB
testcase_18 AC 311 ms
49,048 KB
testcase_19 AC 293 ms
35,652 KB
testcase_20 AC 316 ms
49,104 KB
testcase_21 AC 296 ms
34,188 KB
testcase_22 AC 294 ms
34,444 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (259 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/

ソースコード

diff #

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"
0