結果

問題 No.51 やる気の問題
コンテスト
ユーザー seinyan
提出日時 2021-11-08 23:33:09
言語 Rust
(1.94.0 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
RE  
実行時間 -
コード長 413 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 6,654 ms
コンパイル使用メモリ 195,960 KB
実行使用メモリ 7,976 KB
最終ジャッジ日時 2026-05-12 05:10:27
合計ジャッジ時間 10,448 ms
ジャッジサーバーID
(参考情報)
tmp-judge_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14 RE * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

fn main() {
    let mut w = input_line::<u32>()[0];
    let d = input_line::<u32>()[0];

    for i in 0..d - 1 {
        w -= w / ((d - i) * (d - i));
    }

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