結果

問題 No.1285 ゴミ捨て
ユーザー tamura2004tamura2004
提出日時 2021-01-21 23:36:05
言語 Ruby
(3.3.0)
結果
AC  
実行時間 157 ms / 2,000 ms
コード長 190 bytes
コンパイル時間 141 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 14,592 KB
最終ジャッジ日時 2024-05-06 14:43:48
合計ジャッジ時間 3,495 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
12,032 KB
testcase_01 AC 77 ms
12,032 KB
testcase_02 AC 77 ms
12,160 KB
testcase_03 AC 75 ms
12,288 KB
testcase_04 AC 75 ms
12,160 KB
testcase_05 AC 76 ms
12,288 KB
testcase_06 AC 90 ms
12,288 KB
testcase_07 AC 157 ms
14,464 KB
testcase_08 AC 89 ms
12,160 KB
testcase_09 AC 107 ms
13,184 KB
testcase_10 AC 137 ms
14,080 KB
testcase_11 AC 137 ms
14,208 KB
testcase_12 AC 121 ms
13,696 KB
testcase_13 AC 123 ms
13,440 KB
testcase_14 AC 139 ms
14,464 KB
testcase_15 AC 126 ms
13,696 KB
testcase_16 AC 90 ms
12,416 KB
testcase_17 AC 92 ms
12,544 KB
testcase_18 AC 91 ms
12,544 KB
testcase_19 AC 103 ms
13,056 KB
testcase_20 AC 89 ms
12,544 KB
testcase_21 AC 94 ms
12,928 KB
testcase_22 AC 145 ms
14,464 KB
testcase_23 AC 151 ms
14,592 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