結果

問題 No.32 貯金箱の憂鬱
ユーザー natu7925s
提出日時 2025-06-12 14:25:20
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 489 bytes
コンパイル時間 14,651 ms
コンパイル使用メモリ 399,832 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-12 14:25:36
合計ジャッジ時間 13,768 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: value assigned to `total_money` is never read
  --> src/main.rs:20:9
   |
20 |         total_money %= 1;
   |         ^^^^^^^^^^^
   |
   = help: maybe it is overwritten before being read?
   = note: `#[warn(unused_assignments)]` on by default

ソースコード

diff #

// yukicoder Lv.1 No.32 貯金箱の憂鬱
use proconio::input;

fn main() {
    input! {
        l: i32,
        m: i32,
        n: i32,
    }

    let mut total_money = l * 100 + m * 25 + n * 1;
    let mut coin = 0;
    if total_money > 0 {
        total_money %= 1000;
        coin += total_money / 100;
        total_money %= 100;
        coin += total_money / 25;
        total_money %= 25;
        coin += total_money / 1;
        total_money %= 1;
    }
    println!("{}", coin);
}
0