結果

問題 No.1235 ζ関数
ユーザー 遭難者遭難者
提出日時 2020-09-21 15:03:09
言語 Java21
(openjdk 21)
結果
AC  
実行時間 188 ms / 2,000 ms
コード長 396 bytes
コンパイル時間 3,458 ms
コンパイル使用メモリ 71,712 KB
実行使用メモリ 56,076 KB
最終ジャッジ日時 2023-09-06 17:16:02
合計ジャッジ時間 8,402 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 188 ms
55,624 KB
testcase_01 AC 181 ms
55,940 KB
testcase_02 AC 181 ms
55,576 KB
testcase_03 AC 181 ms
55,776 KB
testcase_04 AC 188 ms
55,624 KB
testcase_05 AC 181 ms
55,732 KB
testcase_06 AC 182 ms
55,796 KB
testcase_07 AC 182 ms
56,076 KB
testcase_08 AC 182 ms
55,680 KB
testcase_09 AC 181 ms
56,036 KB
testcase_10 AC 180 ms
55,456 KB
testcase_11 AC 181 ms
55,608 KB
testcase_12 AC 182 ms
55,876 KB
testcase_13 AC 181 ms
56,020 KB
testcase_14 AC 181 ms
55,908 KB
testcase_15 AC 180 ms
55,528 KB
testcase_16 AC 186 ms
55,380 KB
testcase_17 AC 180 ms
55,876 KB
testcase_18 AC 180 ms
55,636 KB
testcase_19 AC 181 ms
55,612 KB
testcase_20 AC 183 ms
55,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;
public class Main {
    public static void main(String[]args){
		Scanner sc = new Scanner(System.in);
		PrintWriter ou = new PrintWriter(System.out);
		int n = Integer.parseInt(sc.next());
		sc.close();
		double yo = 0;
		for(int i = 1 ; i <= Math.pow(10 , 6) ; i++){
			yo += 1 / Math.pow(i , n);
		}
		ou.println(yo);
		ou.flush();
	}
}
0