結果

問題 No.454 逆2乗和
ユーザー 37zigen37zigen
提出日時 2016-12-01 00:37:37
言語 Java21
(openjdk 21)
結果
AC  
実行時間 213 ms / 2,000 ms
コード長 541 bytes
コンパイル時間 4,097 ms
コンパイル使用メモリ 72,412 KB
実行使用メモリ 56,516 KB
最終ジャッジ日時 2023-08-20 03:00:54
合計ジャッジ時間 12,249 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 195 ms
55,960 KB
testcase_01 AC 182 ms
56,136 KB
testcase_02 AC 165 ms
56,256 KB
testcase_03 AC 180 ms
55,800 KB
testcase_04 AC 188 ms
55,996 KB
testcase_05 AC 181 ms
56,060 KB
testcase_06 AC 128 ms
56,148 KB
testcase_07 AC 198 ms
56,124 KB
testcase_08 AC 176 ms
55,832 KB
testcase_09 AC 201 ms
56,276 KB
testcase_10 AC 158 ms
55,936 KB
testcase_11 AC 193 ms
56,064 KB
testcase_12 AC 171 ms
56,060 KB
testcase_13 AC 185 ms
55,976 KB
testcase_14 AC 172 ms
55,936 KB
testcase_15 AC 184 ms
55,720 KB
testcase_16 AC 168 ms
56,516 KB
testcase_17 AC 195 ms
56,156 KB
testcase_18 AC 189 ms
56,232 KB
testcase_19 AC 175 ms
56,188 KB
testcase_20 AC 178 ms
56,064 KB
testcase_21 AC 117 ms
55,944 KB
testcase_22 AC 140 ms
56,500 KB
testcase_23 AC 204 ms
56,132 KB
testcase_24 AC 213 ms
55,988 KB
testcase_25 AC 200 ms
55,968 KB
testcase_26 AC 193 ms
55,788 KB
testcase_27 AC 196 ms
56,196 KB
testcase_28 AC 161 ms
55,728 KB
testcase_29 AC 213 ms
55,904 KB
testcase_30 AC 198 ms
56,144 KB
testcase_31 AC 204 ms
55,760 KB
testcase_32 AC 198 ms
56,156 KB
testcase_33 AC 193 ms
56,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.*;

public class Q1436 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double res = Math.PI * Math.PI / 6;
		double ans = 0;
		double i = 1;
		double x = sc.nextDouble();
		ans = 0;
		i = 1;
		int d = (int) x;
		for (double j = 1; j <= d; ++j)
			res -= 1 / (j * j);
		for (; res - res * Math.pow(Math.E, -x / i) > 0.0000000001; ++i) {
			ans += 1 / ((i + x) * (i + x));
			res -= 1 / ((i + d) * (i + d));
		}
		ans += res;

		System.out.printf("%.20f\n", ans);
	}
}
0