結果
問題 | No.216 FAC |
ユーザー |
|
提出日時 | 2017-05-07 21:16:33 |
言語 | F# (F# 4.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 672 bytes |
コンパイル時間 | 9,829 ms |
コンパイル使用メモリ | 185,552 KB |
実行使用メモリ | 37,376 KB |
最終ジャッジ日時 | 2024-09-14 14:51:37 |
合計ジャッジ時間 | 14,019 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 RE * 1 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (640 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 solve a_seq b_seq = let ab_seq = Seq.zip a_seq b_seq let other_score = Seq.filter (fun (a, b) -> b <> 0) ab_seq |> Seq.groupBy (fun (a, b) -> b) |> Seq.map (fun (b, ab_seq) -> Seq.sumBy (fun (a, b) -> a) ab_seq) |> Seq.maxBy id let k_score = Seq.filter (fun (a, b) -> b = 0) ab_seq |> Seq.sumBy (fun (a, b) -> a) if k_score >= other_score then "YES" else "NO" let () = let _ = stdin.ReadLine() let a_lst = stdin.ReadLine().Split() |> Seq.map int let b_lst = stdin.ReadLine().Split() |> Seq.map int solve a_lst b_lst |> printfn "%s"