結果
| 問題 |
No.1285 ゴミ捨て
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-01-21 23:36:05 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 143 ms / 2,000 ms |
| コード長 | 190 bytes |
| コンパイル時間 | 43 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 14,464 KB |
| 最終ジャッジ日時 | 2024-11-28 22:00:00 |
| 合計ジャッジ時間 | 3,417 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
コンパイルメッセージ
Syntax OK
ソースコード
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