結果

問題 No.454 逆2乗和
ユーザー 🐬hec🐬hec
提出日時 2016-12-06 12:38:50
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 401 bytes
コンパイル時間 1,328 ms
コンパイル使用メモリ 165,896 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-06 00:27:19
合計ジャッジ時間 4,381 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
5,248 KB
testcase_01 WA -
testcase_02 AC 62 ms
5,376 KB
testcase_03 AC 62 ms
5,376 KB
testcase_04 WA -
testcase_05 AC 61 ms
5,376 KB
testcase_06 AC 64 ms
5,376 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 64 ms
5,376 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 62 ms
5,376 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 61 ms
5,376 KB
testcase_17 AC 62 ms
5,376 KB
testcase_18 WA -
testcase_19 AC 62 ms
5,376 KB
testcase_20 WA -
testcase_21 AC 62 ms
5,376 KB
testcase_22 AC 63 ms
5,376 KB
testcase_23 AC 61 ms
5,376 KB
testcase_24 AC 63 ms
5,376 KB
testcase_25 AC 60 ms
5,376 KB
testcase_26 AC 61 ms
5,376 KB
testcase_27 AC 63 ms
5,376 KB
testcase_28 AC 61 ms
5,376 KB
testcase_29 AC 61 ms
5,376 KB
testcase_30 AC 61 ms
5,376 KB
testcase_31 AC 62 ms
5,376 KB
testcase_32 AC 62 ms
5,376 KB
testcase_33 AC 61 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using R=long double;
int main(void){
	R x;
	cin >> x;
	R ans=0.0;

	const int limit=10000000.0;
	
	R cur=x+limit;
	while(cur>x){
		ans+=1.0/cur/cur;
		cur-=1.0;
	}

	R offset=0.0;
	cur=limit;
	while(cur>=1.0){
		offset+=1.0/cur/cur;
		cur-=1.0;
	}

	ans+=acos(-1.0)*acos(-1.0)/6.0-offset;

	cout.precision(20);
	cout <<  fixed << ans << endl;
	return 0;
}
0