結果

問題 No.1285 ゴミ捨て
ユーザー semisagisemisagi
提出日時 2020-11-13 21:27:42
言語 OCaml
(5.1.0)
結果
AC  
実行時間 66 ms / 2,000 ms
コード長 288 bytes
コンパイル時間 1,847 ms
コンパイル使用メモリ 19,624 KB
実行使用メモリ 6,420 KB
最終ジャッジ日時 2023-08-19 07:11:57
合計ジャッジ時間 3,688 ms
ジャッジサーバーID
(参考情報)
judge10 / judge9
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 62 ms
6,336 KB
testcase_08 AC 4 ms
4,548 KB
testcase_09 AC 28 ms
6,032 KB
testcase_10 AC 55 ms
6,236 KB
testcase_11 AC 51 ms
6,240 KB
testcase_12 AC 38 ms
6,148 KB
testcase_13 AC 37 ms
6,116 KB
testcase_14 AC 58 ms
6,376 KB
testcase_15 AC 44 ms
6,076 KB
testcase_16 AC 14 ms
5,772 KB
testcase_17 AC 14 ms
5,780 KB
testcase_18 AC 12 ms
5,732 KB
testcase_19 AC 25 ms
5,892 KB
testcase_20 AC 12 ms
5,848 KB
testcase_21 AC 16 ms
5,816 KB
testcase_22 AC 66 ms
6,376 KB
testcase_23 AC 65 ms
6,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

let read_int () = Scanf.scanf " %d" (fun x -> x);;

let n = read_int ();;
let a = Array.init n (fun _ -> read_int ());;
Array.sort compare a;;

let all = ref true;;
for i = 0 to n - 2 do
  if a.(i) + 1 >= a.(i + 1) then
    all := false
done;;

print_endline (if !all then "1" else "2");;
0