結果

問題 No.32 貯金箱の憂鬱
コンテスト
ユーザー muzui
提出日時 2021-11-24 22:40:59
言語 Ruby
(4.0.1)
コンパイル:
ruby -w -c _filename_
実行:
ruby _filename_
結果
WA  
実行時間 -
コード長 339 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 209 ms
コンパイル使用メモリ 8,960 KB
実行使用メモリ 14,848 KB
最終ジャッジ日時 2026-03-14 21:04:34
合計ジャッジ時間 1,692 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3 WA * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:10: warning: possibly useless use of + in void context
Main.rb:17: warning: possibly useless use of + in void context
Syntax OK

ソースコード

diff #
raw source code

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

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

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

if (l * 100) % 1000 >= 10
  puts count
else
  puts count += (l * 100) % 1000
end

0