結果

問題 No.1271 初めての級数
ユーザー 57tggx57tggx
提出日時 2020-09-20 21:51:17
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 156 ms / 2,000 ms
コード長 179 bytes
コンパイル時間 489 ms
コンパイル使用メモリ 62,672 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-06 16:34:20
合計ジャッジ時間 3,317 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>

int main(){
	int k;
	scanf("%d", &k);

	double ans = 0;
	for(long long i = 1; i < 100000000; ++i){
		ans += 1. / (i * (i + k));
	}
	printf("%.12f\n", ans);
}
0