結果

問題 No.32 貯金箱の憂鬱
ユーザー naotest2naotest2
提出日時 2017-05-22 14:45:15
言語 Ruby
(3.3.0)
結果
AC  
実行時間 75 ms / 5,000 ms
コード長 280 bytes
コンパイル時間 55 ms
コンパイル使用メモリ 11,260 KB
実行使用メモリ 15,356 KB
最終ジャッジ日時 2023-09-30 10:30:46
合計ジャッジ時間 2,063 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
15,088 KB
testcase_01 AC 71 ms
15,060 KB
testcase_02 AC 68 ms
15,308 KB
testcase_03 AC 68 ms
15,164 KB
testcase_04 AC 75 ms
15,048 KB
testcase_05 AC 70 ms
15,180 KB
testcase_06 AC 73 ms
15,356 KB
testcase_07 AC 72 ms
15,096 KB
testcase_08 AC 71 ms
15,048 KB
testcase_09 AC 72 ms
15,092 KB
testcase_10 AC 71 ms
15,184 KB
testcase_11 AC 69 ms
15,160 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:7: warning: assigned but unused variable - s4
Syntax OK

ソースコード

diff #

L=gets.to_i
M=gets.to_i
N=gets.to_i

def ryougae(x,y,z)
  total = x + y * 25 + z * 100
  s4 = (total / 1000).to_i
  s3 = ((total % 1000) / 100).to_i
  s2 = (((total % 1000) % 100) / 25).to_i
  s1 = (((total % 1000) % 100) % 25).to_i
  return s3 + s2 + s1
end

puts ryougae(N,M,L)
0