結果

問題 No.1285 ゴミ捨て
ユーザー tamura2004tamura2004
提出日時 2021-01-21 23:36:05
言語 Ruby
(3.3.0)
結果
AC  
実行時間 158 ms / 2,000 ms
コード長 190 bytes
コンパイル時間 120 ms
コンパイル使用メモリ 11,548 KB
実行使用メモリ 17,556 KB
最終ジャッジ日時 2023-08-19 07:29:02
合計ジャッジ時間 4,019 ms
ジャッジサーバーID
(参考情報)
judge9 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,088 KB
testcase_01 AC 80 ms
15,292 KB
testcase_02 AC 81 ms
15,012 KB
testcase_03 AC 83 ms
15,260 KB
testcase_04 AC 84 ms
15,112 KB
testcase_05 AC 81 ms
15,344 KB
testcase_06 AC 83 ms
15,072 KB
testcase_07 AC 155 ms
17,508 KB
testcase_08 AC 86 ms
15,284 KB
testcase_09 AC 114 ms
16,132 KB
testcase_10 AC 146 ms
17,160 KB
testcase_11 AC 144 ms
17,056 KB
testcase_12 AC 128 ms
16,632 KB
testcase_13 AC 126 ms
16,732 KB
testcase_14 AC 152 ms
17,264 KB
testcase_15 AC 134 ms
16,740 KB
testcase_16 AC 98 ms
15,704 KB
testcase_17 AC 99 ms
15,724 KB
testcase_18 AC 98 ms
15,508 KB
testcase_19 AC 113 ms
16,280 KB
testcase_20 AC 95 ms
15,644 KB
testcase_21 AC 99 ms
15,824 KB
testcase_22 AC 158 ms
17,556 KB
testcase_23 AC 157 ms
17,500 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.to_s.to_i
a = Array.new(n) { gets.to_s.to_i }.sort
case n
when 1
  puts 1
  exit
else
  a.each_cons(2) do |i, j|
    if j - i == 1
      puts 2
      exit
    end
  end
end

puts 1
0