結果
| 問題 | No.128 お年玉(1) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-10-04 13:36:04 |
| 言語 | Rust (1.97.1 + proconio + num + itertools + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 0 ms / 5,000 ms |
| + 861µs | |
| コード長 | 777 bytes |
| 記録 | |
| コンパイル時間 | 4,244 ms |
| コンパイル使用メモリ | 174,052 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-09-07 11:48:03 |
| 合計ジャッジ時間 | 6,299 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
fn getline() -> String {
let mut __ret = String::new();
std::io::stdin().read_line(&mut __ret).ok();
return __ret;
}
fn main() {
let budget: i64 = getline().trim().parse().unwrap();
let number_of_child: i64 = getline().trim().parse().unwrap();
let otoshidama_unit: i64 = 1000;
let otoshidama_per_person: i64;
if budget / number_of_child < otoshidama_unit {
otoshidama_per_person = 0;
} else {
if budget % number_of_child == 0 {
otoshidama_per_person = budget / number_of_child;
} else {
let number_of_thousand_yen = (budget / number_of_child) / 1000;
otoshidama_per_person = number_of_thousand_yen * otoshidama_unit;
}
}
println!("{}", otoshidama_per_person);
}