結果

問題 No.1235 ζ関数
ユーザー 37zigen37zigen
提出日時 2020-09-21 16:02:01
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 446 bytes
コンパイル時間 4,680 ms
コンパイル使用メモリ 72,220 KB
実行使用メモリ 56,156 KB
最終ジャッジ日時 2023-09-06 17:18:54
合計ジャッジ時間 5,765 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
55,604 KB
testcase_01 AC 132 ms
55,948 KB
testcase_02 AC 132 ms
55,924 KB
testcase_03 AC 123 ms
55,592 KB
testcase_04 AC 124 ms
56,156 KB
testcase_05 AC 123 ms
55,804 KB
testcase_06 AC 122 ms
55,756 KB
testcase_07 AC 123 ms
56,136 KB
testcase_08 AC 121 ms
54,192 KB
testcase_09 AC 124 ms
55,960 KB
testcase_10 AC 132 ms
55,908 KB
testcase_11 AC 133 ms
55,604 KB
testcase_12 AC 131 ms
55,592 KB
testcase_13 AC 131 ms
55,728 KB
testcase_14 AC 131 ms
55,588 KB
testcase_15 AC 132 ms
55,656 KB
testcase_16 AC 125 ms
55,864 KB
testcase_17 AC 123 ms
55,880 KB
testcase_18 AC 122 ms
55,996 KB
testcase_19 AC 123 ms
56,072 KB
testcase_20 AC 122 ms
55,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
import java.util.Stack;

class Main {
	public static void main(String[] $) {
		new Main().run();
	}
	
	void run() {
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		double ans=0;
		for (double i=1;i<1e5;++i) {
			ans+=Math.pow(1/i, N);
		}
		System.out.println(ans);
		
	}
	
	void tr(Object...objects) {System.out.println(Arrays.deepToString(objects));}
}
0