結果

問題 No.1285 ゴミ捨て
ユーザー semisagi
提出日時 2020-11-13 21:25:21
言語 OCaml
(5.2.1)
結果
WA  
実行時間 -
コード長 265 bytes
コンパイル時間 1,753 ms
コンパイル使用メモリ 21,576 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-08 23:35:30
合計ジャッジ時間 4,339 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13 WA * 9
権限があれば一括ダウンロードができます

ソースコード

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