結果

問題 No.1285 ゴミ捨て
ユーザー semisagisemisagi
提出日時 2020-11-13 21:25:21
言語 OCaml
(5.1.0)
結果
WA  
実行時間 -
コード長 265 bytes
コンパイル時間 1,501 ms
コンパイル使用メモリ 21,704 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-17 08:29:53
合計ジャッジ時間 3,195 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 1 ms
6,940 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 27 ms
6,940 KB
testcase_08 WA -
testcase_09 AC 13 ms
6,940 KB
testcase_10 AC 24 ms
6,940 KB
testcase_11 AC 22 ms
6,944 KB
testcase_12 AC 17 ms
6,940 KB
testcase_13 AC 17 ms
6,940 KB
testcase_14 AC 26 ms
6,940 KB
testcase_15 AC 19 ms
6,944 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 13 ms
6,944 KB
testcase_20 WA -
testcase_21 AC 8 ms
6,940 KB
testcase_22 AC 29 ms
6,940 KB
testcase_23 AC 29 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

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