結果
問題 | No.32 貯金箱の憂鬱 |
ユーザー | hitoyozake |
提出日時 | 2018-05-03 21:46:28 |
言語 | Rust (1.77.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 622 bytes |
コンパイル時間 | 688 ms |
コンパイル使用メモリ | 135,872 KB |
実行使用メモリ | 4,384 KB |
最終ジャッジ日時 | 2023-09-10 09:24:12 |
合計ジャッジ時間 | 1,307 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,376 KB |
testcase_01 | AC | 1 ms
4,376 KB |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | AC | 1 ms
4,380 KB |
testcase_10 | WA | - |
testcase_11 | WA | - |
コンパイルメッセージ
warning: unused variable: `x` --> Main.rs:7:9 | 7 | let x = std::io::stdin().read_line(& mut buf).ok(); | ^ help: if this is intentional, prefix it with an underscore: `_x` | = note: `#[warn(unused_variables)]` on by default warning: 1 warning emitted
ソースコード
fn read_line()->String{ let mut buf = String::new(); let x = std::io::stdin().read_line(& mut buf).ok(); buf } fn main() { let mut l = read_line().trim().parse::<i32>().unwrap(); let mut m = read_line().trim().parse::<i32>().unwrap(); let mut n = read_line().trim().parse::<i32>().unwrap(); m = m + l / 25; // 25円玉に1円玉を両替した結果を反映 l = l % 25; // 両替したのでその分減らす(あまり) n = n + m/4; // 25*4 -> 100円にする m = m % 4; n = n % 10; //println!("l:{}, m:{}, n:{}", l, m, n); println!("{}", l + m + n); }