結果

問題 No.1271 初めての級数
ユーザー phsplsphspls
提出日時 2022-10-09 02:09:28
言語 Rust
(1.77.0)
結果
AC  
実行時間 302 ms / 2,000 ms
コード長 280 bytes
コンパイル時間 2,564 ms
コンパイル使用メモリ 137,316 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-05 06:54:20
合計ジャッジ時間 6,402 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 301 ms
4,500 KB
testcase_01 AC 301 ms
4,376 KB
testcase_02 AC 302 ms
4,384 KB
testcase_03 AC 302 ms
4,380 KB
testcase_04 AC 302 ms
4,380 KB
testcase_05 AC 301 ms
4,380 KB
testcase_06 AC 301 ms
4,376 KB
testcase_07 AC 302 ms
4,380 KB
testcase_08 AC 301 ms
4,380 KB
testcase_09 AC 302 ms
4,380 KB
testcase_10 AC 302 ms
4,376 KB
testcase_11 AC 302 ms
4,380 KB
testcase_12 AC 301 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

fn main() {
    let mut k = String::new();
    std::io::stdin().read_line(&mut k).ok();
    let k: usize = k.trim().parse().unwrap();

    let mut result = 0.;
    for n in 1..100000000 {
        result += 1. / (n as f64) / (n + k) as f64;
    }
    println!("{:.09}", result);
}
0