結果

問題 No.542 1円玉と5円玉
ユーザー TANIGUCHI KousukeTANIGUCHI Kousuke
提出日時 2019-11-22 10:17:25
言語 Ruby
(3.2.2)
結果
RE  
実行時間 -
コード長 181 bytes
コンパイル時間 339 ms
コンパイル使用メモリ 11,468 KB
実行使用メモリ 15,332 KB
最終ジャッジ日時 2023-08-01 10:37:23
合計ジャッジ時間 2,002 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,168 KB
testcase_01 AC 83 ms
15,200 KB
testcase_02 AC 81 ms
15,028 KB
testcase_03 AC 80 ms
15,312 KB
testcase_04 AC 81 ms
15,160 KB
testcase_05 AC 83 ms
15,144 KB
testcase_06 AC 82 ms
15,052 KB
testcase_07 AC 82 ms
15,136 KB
testcase_08 AC 82 ms
15,100 KB
testcase_09 AC 83 ms
15,048 KB
testcase_10 AC 82 ms
15,132 KB
testcase_11 AC 83 ms
15,096 KB
testcase_12 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

A, B = gets.split.map(&:to_i)
dp = Array.new(600, 0)
(0 .. A).each do |a|
  (0 .. B).each do |b|
    dp[a + 5 * b] += 1
  end
end
puts dp.each_index.select{|i| i > 0 && dp[i] > 0 }
0