結果
| 問題 |
No.216 FAC
|
| コンテスト | |
| ユーザー |
r6eve
|
| 提出日時 | 2017-08-11 12:46:14 |
| 言語 | OCaml (5.2.1) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 400 bytes |
| コンパイル時間 | 451 ms |
| コンパイル使用メモリ | 21,580 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-09 00:12:35 |
| 合計ジャッジ時間 | 1,239 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
let read () = Scanf.scanf "%d " (fun i -> i) let max (x : int) y = if x > y then x else y let () = let n = read () in let a = Array.init n (fun _ -> read ()) in let b = Array.init n (fun _ -> read ()) in let c = Array.make 101 0 in Array.iteri (fun i b -> c.(b) <- c.(b) + a.(i)) b; let m = Array.fold_left (fun m e -> max m e) 0 c in print_endline (if c.(0) = m then "YES" else "NO")
r6eve