結果
問題 | No.216 FAC |
ユーザー |
![]() |
提出日時 | 2017-08-11 12:43:17 |
言語 | OCaml (5.2.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 395 bytes |
コンパイル時間 | 358 ms |
コンパイル使用メモリ | 21,444 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-09 00:12:42 |
合計ジャッジ時間 | 1,348 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 WA * 3 RE * 15 |
ソースコード
let read () = Scanf.scanf "%d " (fun i -> i)let max (x : int) y = if x > y then x else ylet () =let n = read () inlet a = Array.init n (fun _ -> read ()) inlet b = Array.init n (fun _ -> read ()) inlet c = Array.make n 0 inArray.iter (fun b -> c.(b) <- c.(b) + a.(b)) b;let m = Array.fold_left (fun m e -> max m e) 0 c inprint_endline (if c.(0) = m then "YES" else "NO")