結果

問題 No.816 Beautiful tuples
ユーザー pekempeypekempey
提出日時 2019-04-19 21:34:29
言語 Ruby
(3.1.1p18 )
結果
AC  
実行時間 69 ms / 1,500 ms
コード長 171 bytes
コンパイル時間 121 ms
使用メモリ 14,076 KB
最終ジャッジ日時 2022-11-22 06:34:09
合計ジャッジ時間 2,448 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 67 ms
13,976 KB
testcase_01 AC 68 ms
13,724 KB
testcase_02 AC 66 ms
13,832 KB
testcase_03 AC 67 ms
13,792 KB
testcase_04 AC 69 ms
13,800 KB
testcase_05 AC 66 ms
14,056 KB
testcase_06 AC 67 ms
13,768 KB
testcase_07 AC 67 ms
13,720 KB
testcase_08 AC 69 ms
13,980 KB
testcase_09 AC 65 ms
14,076 KB
testcase_10 AC 64 ms
13,816 KB
testcase_11 AC 64 ms
13,792 KB
testcase_12 AC 67 ms
13,952 KB
testcase_13 AC 65 ms
13,840 KB
testcase_14 AC 65 ms
13,836 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a, b = gets.split.map(&:to_i)
if a > b
  a, b = b, a
end

if 3*a == b
  puts "#{2*a}"
elsif 3*a == 2*b
  puts "#{a/2}"
elsif b == 2*a
  puts "#{3*a}"
else
  puts "-1"
end
0