結果

問題 No.365 ジェンガソート
ユーザー はむ吉🐹はむ吉🐹
提出日時 2016-05-05 19:37:24
言語 OCaml
(5.1.0)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 368 bytes
コンパイル時間 188 ms
コンパイル使用メモリ 19,568 KB
実行使用メモリ 15,228 KB
最終ジャッジ日時 2024-04-17 08:33:40
合計ジャッジ時間 1,938 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 1 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 31 ms
13,228 KB
testcase_17 AC 34 ms
14,668 KB
testcase_18 AC 4 ms
5,376 KB
testcase_19 AC 32 ms
14,412 KB
testcase_20 AC 10 ms
6,400 KB
testcase_21 AC 8 ms
6,016 KB
testcase_22 AC 26 ms
11,248 KB
testcase_23 AC 17 ms
9,216 KB
testcase_24 AC 25 ms
11,928 KB
testcase_25 AC 8 ms
5,632 KB
testcase_26 AC 19 ms
10,112 KB
testcase_27 AC 37 ms
15,160 KB
testcase_28 AC 22 ms
11,212 KB
testcase_29 AC 30 ms
14,004 KB
testcase_30 AC 22 ms
11,348 KB
testcase_31 AC 10 ms
6,656 KB
testcase_32 AC 11 ms
7,040 KB
testcase_33 AC 37 ms
15,112 KB
testcase_34 AC 7 ms
5,504 KB
testcase_35 AC 24 ms
10,852 KB
testcase_36 AC 38 ms
15,224 KB
testcase_37 AC 40 ms
15,224 KB
testcase_38 AC 40 ms
15,224 KB
testcase_39 AC 40 ms
15,224 KB
testcase_40 AC 39 ms
15,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

let words s =
    let r = Str.regexp " +" in
    Str.split r s

let min_num_of_ops n xs =
	let rec mnoo t = function
		[] -> t
		| y :: ys -> if y = t then mnoo (t - 1) ys else mnoo t ys
	in mnoo n (List.rev xs)
		
let () =
    let n = read_int () in
    let xs = List.map int_of_string (words (read_line ())) in
    let ans = min_num_of_ops n xs in
    print_int ans
0