結果

問題 No.1285 ゴミ捨て
ユーザー thglaflsthglafls
提出日時 2023-04-30 23:50:15
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 367 bytes
コンパイル時間 13,458 ms
コンパイル使用メモリ 185,936 KB
実行使用メモリ 43,424 KB
最終ジャッジ日時 2024-04-30 02:15:42
合計ジャッジ時間 22,070 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 342 ms
35,184 KB
testcase_01 AC 345 ms
34,928 KB
testcase_02 AC 347 ms
35,312 KB
testcase_03 AC 346 ms
35,304 KB
testcase_04 AC 338 ms
35,248 KB
testcase_05 AC 344 ms
35,436 KB
testcase_06 AC 342 ms
35,552 KB
testcase_07 WA -
testcase_08 AC 346 ms
35,608 KB
testcase_09 AC 361 ms
38,204 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 355 ms
36,280 KB
testcase_17 AC 357 ms
36,556 KB
testcase_18 AC 356 ms
37,136 KB
testcase_19 WA -
testcase_20 AC 353 ms
36,948 KB
testcase_21 AC 360 ms
37,748 KB
testcase_22 WA -
testcase_23 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (384 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 calc a =
    let a_sorted = Array.append (Array.sort a) [| 0 |]
    let index = [| 1 .. a_sorted.Length - 1 |]
    (Array.filter (fun i -> a_sorted.[i] - a_sorted.[i - 1] = 1) index).Length + 1

let main =
    let n = stdin.ReadLine() |> int

    let e =
        [| for i = 0 to n - 1 do
               stdin.ReadLine() |> int |]

    printfn "%d" (calc e)
    0
0