結果

問題 No.2194 兄弟の掛け引き
ユーザー uraraurara
提出日時 2023-01-24 04:05:12
言語 Ruby
(3.3.0)
結果
AC  
実行時間 82 ms / 1,000 ms
コード長 202 bytes
コンパイル時間 189 ms
コンパイル使用メモリ 11,548 KB
実行使用メモリ 15,336 KB
最終ジャッジ日時 2023-09-08 03:08:53
合計ジャッジ時間 3,009 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,336 KB
testcase_01 AC 79 ms
15,212 KB
testcase_02 AC 81 ms
15,260 KB
testcase_03 AC 77 ms
15,160 KB
testcase_04 AC 79 ms
15,168 KB
testcase_05 AC 80 ms
15,168 KB
testcase_06 AC 82 ms
15,332 KB
testcase_07 AC 80 ms
15,284 KB
testcase_08 AC 80 ms
15,292 KB
testcase_09 AC 80 ms
15,128 KB
testcase_10 AC 79 ms
15,212 KB
testcase_11 AC 81 ms
15,188 KB
testcase_12 AC 78 ms
15,140 KB
testcase_13 AC 78 ms
15,084 KB
testcase_14 AC 78 ms
15,132 KB
testcase_15 AC 78 ms
15,172 KB
testcase_16 AC 81 ms
15,164 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:13: warning: ambiguous first argument; put parentheses or a space even after `-' operator
Syntax OK

ソースコード

diff #

a,b,c = gets.split.map &:to_i

result = []
if c % a == 0 && c <= b then
	result << c / a
end

if (c + b) % a == 0 then
	result << (c + b) / a
end

if result.size == 0 then
	puts -1
else
	puts result
end
0