結果

問題 No.454 逆2乗和
ユーザー titiatitia
提出日時 2023-08-07 02:52:10
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 339 bytes
コンパイル時間 14,057 ms
コンパイル使用メモリ 378,236 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-07 06:15:00
合計ジャッジ時間 15,340 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: variable `ANS` should have a snake case name
 --> src/main.rs:8:13
  |
8 |     let mut ANS:f64=0.0;
  |             ^^^ help: convert the identifier to snake case: `ans`
  |
  = note: `#[warn(non_snake_case)]` on by default

ソースコード

diff #

fn main() {
    let x: f64 = {
        let mut line: String = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        line.trim().parse().unwrap()
    };

    let mut ANS:f64=0.0;

    for i in 1..200000{
        ANS+=1.0/((i as f64 +x)*(i as f64 +x));
    }

    ANS+=1.0/(x+200000.0);

    println!("{}",ANS);


}
0