結果
問題 | No.32 貯金箱の憂鬱 |
ユーザー | 💕💖💞 |
提出日時 | 2017-07-22 17:33:23 |
言語 | Rust (1.77.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 490 bytes |
コンパイル時間 | 4,181 ms |
コンパイル使用メモリ | 132,460 KB |
実行使用メモリ | 4,380 KB |
最終ジャッジ日時 | 2023-09-30 12:21:12 |
合計ジャッジ時間 | 1,284 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,380 KB |
testcase_01 | AC | 1 ms
4,380 KB |
testcase_02 | AC | 1 ms
4,376 KB |
testcase_03 | AC | 1 ms
4,380 KB |
testcase_04 | AC | 1 ms
4,380 KB |
testcase_05 | AC | 1 ms
4,376 KB |
testcase_06 | AC | 1 ms
4,376 KB |
testcase_07 | AC | 1 ms
4,380 KB |
testcase_08 | AC | 1 ms
4,376 KB |
testcase_09 | AC | 1 ms
4,376 KB |
testcase_10 | AC | 1 ms
4,380 KB |
testcase_11 | AC | 1 ms
4,376 KB |
コンパイルメッセージ
warning: unused imports: `HashMap`, `LinkedList` --> Main.rs:2:24 | 2 | use std::collections::{HashMap, LinkedList}; | ^^^^^^^ ^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default warning: unused variable: `m1000` --> Main.rs:11:7 | 11 | let m1000 = money/1000; | ^^^^^ help: if this is intentional, prefix it with an underscore: `_m1000` | = note: `#[warn(unused_variables)]` on by default warning: 2 warnings emitted
ソースコード
use std::io::{self, BufRead}; use std::collections::{HashMap, LinkedList}; fn main() { let stdin = io::stdin(); let mut money:i32 = 0; for i in [100, 25, 1].iter() { let line = stdin.lock().lines().next().unwrap().unwrap(); money += i*line.parse::<i32>().unwrap(); } let m1000 = money/1000; money = money%1000; let m100 = money/100; money = money%100; let m25 = money/25; money = money%25; let m1 = money/1; println!("{}", m100+m25+m1); }