結果
| 問題 |
No.32 貯金箱の憂鬱
|
| コンテスト | |
| ユーザー |
💕💖💞
|
| 提出日時 | 2017-07-22 17:33:23 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 490 bytes |
| コンパイル時間 | 13,898 ms |
| コンパイル使用メモリ | 404,496 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-23 06:23:46 |
| 合計ジャッジ時間 | 14,075 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 |
コンパイルメッセージ
warning: unused imports: `HashMap`, `LinkedList`
--> src/main.rs:2:24
|
2 | use std::collections::{HashMap, LinkedList};
| ^^^^^^^ ^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused variable: `m1000`
--> src/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
ソースコード
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);
}
💕💖💞