結果
問題 | No.706 多眼生物の調査 |
ユーザー |
![]() |
提出日時 | 2018-07-02 17:50:09 |
言語 | F# (F# 4.0) |
結果 |
AC
|
実行時間 | 105 ms / 2,000 ms |
コード長 | 577 bytes |
コンパイル時間 | 10,037 ms |
コンパイル使用メモリ | 195,324 KB |
実行使用メモリ | 33,792 KB |
最終ジャッジ日時 | 2024-07-01 01:32:37 |
合計ジャッジ時間 | 11,566 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 5 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (486 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 System.Collections.Genericlet getV (d:Dictionary<_,_>) k =match d.TryGetValue(k) with| true, n -> n+1| _ -> 1let init (d:Dictionary<_,_>) =seq { for _ in 1..(stdin.ReadLine() |> int) -> stdin.ReadLine().Length }|> Seq.iter (fun k -> d.[k] <- getV d k)let pred a b =if (snd a)=(snd b) && (fst a)<(fst b) || (snd a)<(snd b) then b else alet f () =let d = Dictionary<int,int>()init d |> ignoreseq { for e in d -> (e.Key,e.Value) }|> Seq.fold (fun a e -> pred a e) (0,0)|> fun e -> fst e - 2f () |> printfn "%A"