結果

問題 No.1686 Geschenkt
ユーザー horiesiniti
提出日時 2022-12-27 20:26:17
言語 Ruby
(3.4.1)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 112 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 7,296 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-11-22 06:56:27
合計ジャッジ時間 1,684 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

n=gets.to_i
a=gets.split(" ").map{|e| e.to_i}.sort
ans=a[0]
a.each_cons(2){|e1,e2| ans+=(e2-e1>1)?e2:0}
puts ans
0