結果

問題 No.216 FAC
ユーザー r6ever6eve
提出日時 2017-08-11 12:45:27
言語 OCaml
(5.1.0)
結果
RE  
実行時間 -
コード長 397 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 21,576 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-17 08:39:38
合計ジャッジ時間 1,094 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 3 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 AC 2 ms
5,376 KB
testcase_08 WA -
testcase_09 AC 2 ms
5,376 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 2 ms
5,376 KB
testcase_17 RE -
testcase_18 AC 2 ms
5,376 KB
testcase_19 RE -
testcase_20 RE -
testcase_21 AC 1 ms
5,376 KB
testcase_22 RE -
testcase_23 AC 2 ms
5,376 KB
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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.iter (fun b -> c.(b) <- c.(b) + a.(b)) 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")
0