結果
| 問題 |
No.51 やる気の問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-11-08 23:35:39 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 449 bytes |
| コンパイル時間 | 13,594 ms |
| コンパイル使用メモリ | 379,416 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-17 02:59:43 |
| 合計ジャッジ時間 | 13,829 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
fn main() {
let mut w = input_line::<i64>()[0];
let d = input_line::<i64>()[0];
for i in 0..d - 1 {
w -= w / ((d - i) * (d - i));
}
if w < 0 {
w = 0;
}
println!("{}", w);
}
fn input_line<T: std::str::FromStr>() -> Vec<T> {
let mut s = String::new();
std::io::stdin().read_line(&mut s).ok();
s.trim()
.split_whitespace()
.map(|e| e.parse().ok().unwrap())
.collect()
}