結果
問題 | No.799 赤黒かーどげぇむ |
ユーザー |
![]() |
提出日時 | 2019-03-27 03:37:50 |
言語 | F# (F# 4.0) |
結果 |
AC
|
実行時間 | 79 ms / 2,000 ms |
コード長 | 534 bytes |
コンパイル時間 | 6,865 ms |
コンパイル使用メモリ | 187,932 KB |
実行使用メモリ | 30,976 KB |
最終ジャッジ日時 | 2024-10-11 01:41:04 |
合計ジャッジ時間 | 9,316 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (233 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/
ソースコード
open Systemlet solve a b c d =let cdSet = [c .. d] |> Set.ofListlet cdSetSize = d - c + 1let cnts = [a .. b] |> Seq.countBy(fun x -> Set.contains x cdSet)let getCount flag = Seq.tryFind(fun (k, _) -> k = flag) >> Option.map snd >> Option.defaultValue 0let t1 = cnts |> getCount falselet t2 = cnts |> getCount truecdSetSize * t1 + (cdSetSize - 1) * t2let a, b, c, d =let t = Console.ReadLine().Split() |> Array.map intt.[0], t.[1], t.[2], t.[3]solve a b c d|> Console.WriteLine