結果

問題 No.780 オフ会
ユーザー pink_bangbipink_bangbi
提出日時 2020-11-06 20:22:49
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 158 bytes
コンパイル時間 116 ms
コンパイル使用メモリ 11,296 KB
実行使用メモリ 15,368 KB
最終ジャッジ日時 2023-09-29 17:54:22
合計ジャッジ時間 2,882 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,248 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 72 ms
15,176 KB
testcase_05 AC 73 ms
15,128 KB
testcase_06 WA -
testcase_07 AC 75 ms
15,188 KB
testcase_08 AC 77 ms
15,116 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 76 ms
15,128 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 76 ms
15,260 KB
testcase_15 AC 76 ms
15,076 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 75 ms
15,072 KB
testcase_19 WA -
testcase_20 AC 75 ms
15,124 KB
testcase_21 AC 76 ms
15,164 KB
testcase_22 AC 75 ms
15,236 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:5: warning: `elsif' at the end of line without an expression
Main.rb:7: warning: string literal in condition
Syntax OK

ソースコード

diff #

def calc(input)
  a, b = input.split.map(&:to_i)
  if a < b
    "YES\n#{ b - a - 1 }"
  elsif
    "NO\n#{ a - b }"
  end
end

# p calc("3 4")
puts calc(gets)
0