結果

問題 No.32 貯金箱の憂鬱
ユーザー muzuimuzui
提出日時 2021-11-24 22:44:14
言語 Ruby
(3.3.0)
結果
AC  
実行時間 84 ms / 5,000 ms
コード長 341 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 11,540 KB
実行使用メモリ 15,360 KB
最終ジャッジ日時 2023-09-09 15:30:45
合計ジャッジ時間 1,841 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,180 KB
testcase_01 AC 81 ms
15,056 KB
testcase_02 AC 81 ms
15,316 KB
testcase_03 AC 81 ms
15,276 KB
testcase_04 AC 81 ms
15,092 KB
testcase_05 AC 84 ms
15,220 KB
testcase_06 AC 80 ms
15,224 KB
testcase_07 AC 80 ms
15,360 KB
testcase_08 AC 79 ms
15,300 KB
testcase_09 AC 77 ms
15,088 KB
testcase_10 AC 77 ms
15,264 KB
testcase_11 AC 77 ms
15,096 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

l = gets.chomp!.to_i
m = gets.chomp!.to_i
n = gets.chomp!.to_i

count = 0
if n * 1 < 25
  count += n
else
  m += (n * 1) / 25 
  count += (n * 1) % 25 / 1
end

if m * 25 < 100
  count += m
else
  l += (m * 25) / 100
  count += (m * 25) % 100 / 25
end

if l * 100 < 1000
  puts count
else
  count += (l * 100) % 1000 / 100
  puts count
end

0