結果

問題 No.780 オフ会
ユーザー SHuuuuuuuuuuuuA
提出日時 2019-01-19 16:22:30
言語 Ruby
(3.4.1)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 247 bytes
コンパイル時間 155 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-07-18 00:36:40
合計ジャッジ時間 3,182 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

people = gets.split.map(&:to_i)

if people[0]+1 == people[1]
    puts "YES"
    puts 0
elsif people[0]+1 > people[1]
    puts "NO"
    puts people[0]+1 - people[1]
elsif people[0]+1 < people[1]
    puts "YES"
    puts people[1] - (people[0]+1)
end
0