結果

問題 No.231 めぐるはめぐる (1)
コンテスト
ユーザー r6eve
提出日時 2017-08-16 13:23:52
言語 OCaml
(5.5.0)
コンパイル:
ocamlfind ocamlopt -linkpkg -package zarith,str _filename_ -o a.out
実行:
./a.out
結果
AC  
実行時間 1 ms / 1,000 ms
+ 648µs
コード長 423 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 122 ms
コンパイル使用メモリ 22,692 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2026-09-12 07:17:39
合計ジャッジ時間 1,196 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
ocamlfind: [WARNING] Cannot read directory ./stublibs which is mentioned in ld.conf

ソースコード

diff #
raw source code

let g = 3000000

let () =
  let n = Scanf.scanf "%d " (fun i -> i) in
  let a = Array.init n (fun _ -> Scanf.scanf "%d %d " (fun g d -> g - 30000 * d)) in
  let _, (j, m) = Array.fold_left (fun (i, (j, m)) e ->
    i + 1, if e > m then (i, e) else (j, m))
    (0, (0, 0)) a in
  if 6*m < g then print_endline "NO"
  else begin
    print_endline "YES";
    for _ = 0 to 5 do
      Printf.printf "%d\n" (j + 1)
    done
  end
0