結果

問題 No.1285 ゴミ捨て
ユーザー tamura2004tamura2004
提出日時 2021-01-21 23:34:57
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 183 bytes
コンパイル時間 117 ms
コンパイル使用メモリ 11,528 KB
実行使用メモリ 17,596 KB
最終ジャッジ日時 2023-08-26 15:23:39
合計ジャッジ時間 4,985 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,160 KB
testcase_01 AC 84 ms
15,252 KB
testcase_02 AC 84 ms
15,092 KB
testcase_03 AC 85 ms
15,292 KB
testcase_04 WA -
testcase_05 AC 82 ms
15,300 KB
testcase_06 AC 84 ms
15,148 KB
testcase_07 AC 159 ms
17,504 KB
testcase_08 AC 88 ms
15,124 KB
testcase_09 AC 117 ms
16,244 KB
testcase_10 AC 149 ms
17,040 KB
testcase_11 AC 147 ms
17,072 KB
testcase_12 AC 131 ms
16,812 KB
testcase_13 AC 128 ms
16,560 KB
testcase_14 AC 154 ms
17,596 KB
testcase_15 AC 139 ms
16,608 KB
testcase_16 AC 101 ms
15,692 KB
testcase_17 AC 101 ms
15,476 KB
testcase_18 AC 99 ms
15,576 KB
testcase_19 AC 116 ms
16,168 KB
testcase_20 AC 98 ms
15,460 KB
testcase_21 AC 100 ms
15,984 KB
testcase_22 AC 160 ms
17,492 KB
testcase_23 AC 162 ms
17,472 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
else
  a.each_cons(2) do |i, j|
    if j - i == 1
      puts 2
      exit
    end
  end
end

puts 1
0