結果

問題 No.1285 ゴミ捨て
ユーザー semisagisemisagi
提出日時 2020-11-13 21:27:42
言語 OCaml
(5.1.0)
結果
AC  
実行時間 62 ms / 2,000 ms
コード長 288 bytes
コンパイル時間 1,746 ms
コンパイル使用メモリ 21,572 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2024-05-06 14:25:30
合計ジャッジ時間 3,161 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 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 58 ms
6,400 KB
testcase_08 AC 4 ms
5,376 KB
testcase_09 AC 25 ms
5,888 KB
testcase_10 AC 50 ms
6,272 KB
testcase_11 AC 45 ms
6,144 KB
testcase_12 AC 33 ms
6,016 KB
testcase_13 AC 34 ms
6,016 KB
testcase_14 AC 52 ms
6,272 KB
testcase_15 AC 41 ms
6,144 KB
testcase_16 AC 12 ms
5,760 KB
testcase_17 AC 12 ms
5,760 KB
testcase_18 AC 12 ms
5,632 KB
testcase_19 AC 25 ms
5,888 KB
testcase_20 AC 11 ms
5,760 KB
testcase_21 AC 15 ms
5,632 KB
testcase_22 AC 59 ms
6,272 KB
testcase_23 AC 62 ms
6,400 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