結果

問題 No.454 逆2乗和
ユーザー GrenacheGrenache
提出日時 2016-12-05 09:52:37
言語 Java21
(openjdk 21)
結果
AC  
実行時間 330 ms / 2,000 ms
コード長 769 bytes
コンパイル時間 4,686 ms
コンパイル使用メモリ 73,444 KB
実行使用メモリ 56,364 KB
最終ジャッジ日時 2023-08-20 03:16:45
合計ジャッジ時間 16,879 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 328 ms
56,124 KB
testcase_01 AC 328 ms
55,996 KB
testcase_02 AC 326 ms
55,892 KB
testcase_03 AC 325 ms
56,156 KB
testcase_04 AC 326 ms
55,768 KB
testcase_05 AC 323 ms
55,720 KB
testcase_06 AC 323 ms
55,952 KB
testcase_07 AC 324 ms
56,364 KB
testcase_08 AC 324 ms
56,156 KB
testcase_09 AC 322 ms
56,132 KB
testcase_10 AC 327 ms
55,960 KB
testcase_11 AC 326 ms
55,764 KB
testcase_12 AC 323 ms
56,144 KB
testcase_13 AC 324 ms
56,004 KB
testcase_14 AC 327 ms
56,172 KB
testcase_15 AC 326 ms
56,188 KB
testcase_16 AC 326 ms
56,000 KB
testcase_17 AC 328 ms
56,004 KB
testcase_18 AC 328 ms
56,120 KB
testcase_19 AC 326 ms
56,020 KB
testcase_20 AC 325 ms
56,048 KB
testcase_21 AC 316 ms
55,908 KB
testcase_22 AC 327 ms
55,760 KB
testcase_23 AC 323 ms
56,196 KB
testcase_24 AC 326 ms
55,916 KB
testcase_25 AC 324 ms
55,764 KB
testcase_26 AC 327 ms
56,108 KB
testcase_27 AC 324 ms
55,928 KB
testcase_28 AC 323 ms
55,848 KB
testcase_29 AC 325 ms
56,064 KB
testcase_30 AC 326 ms
55,844 KB
testcase_31 AC 326 ms
56,100 KB
testcase_32 AC 330 ms
56,012 KB
testcase_33 AC 328 ms
56,052 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;


public class Main_yukicoder454 {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		double x = sc.nextDouble();

		double ret = 0;
		for (int i = 10_000_000; i > 0; i--) {
//			double tmp = (x + i) * (x + i);
			ret += ((double)2 * x / i + (double)x * x / i / i)  / (x + i) / (x + i);
		}

//		pr.printf("%.10f\n", ret);
		pr.printf("%.10f\n", Math.PI * Math.PI / 6 - ret);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}
0