結果

問題 No.1101 鼻水
コンテスト
ユーザー phspls
提出日時 2020-07-04 01:59:48
言語 Rust
(1.97.1 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
WA  
実行時間 -
コード長 771 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 566 ms
コンパイル使用メモリ 181,584 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-08-29 08:35:16
合計ジャッジ時間 2,197 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10 WA * 12
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: value assigned to `behind` is never read
  --> src/main.rs:11:29
   |
11 |     let mut behind: usize = 0;
   |                             ^ this value is reassigned later and never used
...
15 |     behind = t - (result - 1) % t;
   |     ----------------------------- `behind` is overwritten here before the previous value is read
   |
   = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default

ソースコード

diff #
raw source code

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);
}
0