結果

問題 No.1273 はじめのζ関数
ユーザー 遭難者遭難者
提出日時 2020-10-31 00:29:44
言語 Java21
(openjdk 21)
結果
AC  
実行時間 229 ms / 2,000 ms
コード長 459 bytes
コンパイル時間 3,241 ms
コンパイル使用メモリ 72,028 KB
実行使用メモリ 57,944 KB
最終ジャッジ日時 2023-09-29 09:31:07
合計ジャッジ時間 12,711 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 220 ms
55,416 KB
testcase_01 AC 217 ms
55,908 KB
testcase_02 AC 229 ms
55,688 KB
testcase_03 AC 217 ms
56,036 KB
testcase_04 AC 216 ms
53,776 KB
testcase_05 AC 217 ms
55,312 KB
testcase_06 AC 216 ms
56,136 KB
testcase_07 AC 218 ms
55,440 KB
testcase_08 AC 216 ms
55,904 KB
testcase_09 AC 229 ms
57,944 KB
testcase_10 AC 214 ms
55,940 KB
testcase_11 AC 216 ms
55,672 KB
testcase_12 AC 216 ms
55,812 KB
testcase_13 AC 215 ms
55,836 KB
testcase_14 AC 217 ms
55,852 KB
testcase_15 AC 226 ms
56,024 KB
testcase_16 AC 228 ms
55,988 KB
testcase_17 AC 218 ms
55,692 KB
testcase_18 AC 228 ms
55,716 KB
testcase_19 AC 226 ms
55,420 KB
testcase_20 AC 216 ms
55,680 KB
testcase_21 AC 206 ms
56,100 KB
testcase_22 AC 214 ms
55,696 KB
testcase_23 AC 213 ms
55,408 KB
testcase_24 AC 213 ms
55,652 KB
testcase_25 AC 212 ms
55,628 KB
testcase_26 AC 207 ms
55,732 KB
testcase_27 AC 205 ms
55,760 KB
testcase_28 AC 207 ms
55,752 KB
testcase_29 AC 206 ms
55,644 KB
testcase_30 AC 208 ms
55,448 KB
testcase_31 AC 215 ms
56,004 KB
testcase_32 AC 205 ms
56,292 KB
testcase_33 AC 214 ms
55,432 KB
testcase_34 AC 208 ms
55,924 KB
testcase_35 AC 215 ms
56,136 KB
testcase_36 AC 205 ms
55,972 KB
testcase_37 AC 204 ms
55,704 KB
testcase_38 AC 204 ms
55,556 KB
testcase_39 AC 204 ms
55,736 KB
testcase_40 AC 180 ms
55,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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