結果
問題 |
No.1101 鼻水
|
ユーザー |
|
提出日時 | 2020-07-04 01:59:48 |
言語 | Rust (1.83.0 + proconio) |
結果 |
WA
|
実行時間 | - |
コード長 | 771 bytes |
コンパイル時間 | 12,644 ms |
コンパイル使用メモリ | 379,376 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-17 06:23:20 |
合計ジャッジ時間 | 13,423 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 WA * 12 |
コンパイルメッセージ
warning: value assigned to `behind` is never read --> src/main.rs:11:13 | 11 | let mut behind: usize = 0; | ^^^^^^ | = help: maybe it is overwritten before being read? = note: `#[warn(unused_assignments)]` on by default
ソースコード
fn main() { let mut vtp = String::new(); std::io::stdin().read_line(&mut vtp).ok(); let vtp: Vec<usize> = vtp.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let v = vtp[0]; let t = vtp[1]; let p = vtp[2]; let mut result = (p + 1) * v; let mut behind: usize = 0; let mut times = (result - 1) / t + if (result - 1) % t > 0 { 1 } else { 0 }; result += times; if (result - 1) % t == 0 { result += 1; } behind = t - (result - 1) % t; while times > 0 && times > behind { times = (times - behind) / t + if (times - behind) % t > 0 { 1 } else { 0 }; if (result - 1) % t == 0 { result += 1; } result += times; behind = t - (result - 1) % t; } println!("{}", result); }