結果

問題 No.564 背の順
ユーザー r6ever6eve
提出日時 2017-09-08 22:53:53
言語 OCaml
(5.1.0)
結果
WA  
実行時間 -
コード長 442 bytes
コンパイル時間 239 ms
コンパイル使用メモリ 21,580 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 08:43:07
合計ジャッジ時間 905 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 3 ms
5,376 KB
testcase_03 WA -
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 3 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

let () =
  let h, n = Scanf.scanf "%d %d " (fun h n -> h, n) in
  let n = n - 1 in
  let a = Array.init n (fun _ -> Scanf.scanf "%d " (fun i -> i)) in
  Array.fast_sort (fun x y -> y - x) a;
  let rec doit i =
    if i = n || h >= a.(i) then i + 1
    else doit (i + 1) in
  let i = doit 0 in
  if i = 1 then print_endline "1st"
  else if i = 2 then print_endline "2nd"
  else if i = 3 then print_endline "3rd"
  else Printf.printf "%dth\n" i
0