結果

問題 No.1271 初めての級数
ユーザー bluemeganebluemegane
提出日時 2021-07-07 07:22:54
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 101 ms / 2,000 ms
コード長 343 bytes
コンパイル時間 811 ms
コンパイル使用メモリ 67,304 KB
実行使用メモリ 24,608 KB
最終ジャッジ日時 2023-09-14 04:33:39
合計ジャッジ時間 2,945 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
16,392 KB
testcase_01 AC 100 ms
22,560 KB
testcase_02 AC 96 ms
22,592 KB
testcase_03 AC 99 ms
22,716 KB
testcase_04 AC 99 ms
24,572 KB
testcase_05 AC 97 ms
22,524 KB
testcase_06 AC 101 ms
22,456 KB
testcase_07 AC 98 ms
22,600 KB
testcase_08 AC 91 ms
22,460 KB
testcase_09 AC 88 ms
24,608 KB
testcase_10 AC 93 ms
22,680 KB
testcase_11 AC 98 ms
22,672 KB
testcase_12 AC 97 ms
22,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;

public class Hello
{
    static void Main()
    {
        var k = int.Parse(Console.ReadLine().Trim());
        getAns(k);
    }
    static void getAns(int k)
    {
        var ans = 0d;
        for (int i = 1; i <= 10000000; i++)
        {
            ans += 1d / i / (i + k);
        }
        Console.WriteLine(ans);
    }
}
0