結果

問題 No.1273 はじめのζ関数
ユーザー 遭難者遭難者
提出日時 2020-10-31 00:13:50
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 504 bytes
コンパイル時間 2,811 ms
コンパイル使用メモリ 72,812 KB
実行使用メモリ 57,860 KB
最終ジャッジ日時 2023-09-29 09:19:41
合計ジャッジ時間 13,074 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 220 ms
56,364 KB
testcase_01 AC 220 ms
55,800 KB
testcase_02 AC 230 ms
55,896 KB
testcase_03 AC 215 ms
55,880 KB
testcase_04 AC 220 ms
55,708 KB
testcase_05 AC 219 ms
55,452 KB
testcase_06 AC 217 ms
56,072 KB
testcase_07 AC 220 ms
55,904 KB
testcase_08 AC 217 ms
57,836 KB
testcase_09 AC 230 ms
56,080 KB
testcase_10 AC 218 ms
55,832 KB
testcase_11 AC 219 ms
55,708 KB
testcase_12 AC 222 ms
54,196 KB
testcase_13 AC 215 ms
56,044 KB
testcase_14 AC 218 ms
56,312 KB
testcase_15 AC 229 ms
56,172 KB
testcase_16 AC 231 ms
56,068 KB
testcase_17 AC 217 ms
55,568 KB
testcase_18 AC 227 ms
56,092 KB
testcase_19 AC 227 ms
55,400 KB
testcase_20 WA -
testcase_21 AC 205 ms
55,836 KB
testcase_22 AC 214 ms
55,860 KB
testcase_23 AC 214 ms
55,884 KB
testcase_24 AC 216 ms
56,296 KB
testcase_25 AC 216 ms
55,540 KB
testcase_26 AC 204 ms
55,480 KB
testcase_27 AC 204 ms
55,684 KB
testcase_28 AC 207 ms
56,240 KB
testcase_29 AC 205 ms
55,440 KB
testcase_30 AC 205 ms
55,652 KB
testcase_31 AC 216 ms
55,720 KB
testcase_32 AC 205 ms
55,680 KB
testcase_33 AC 215 ms
55,940 KB
testcase_34 AC 206 ms
55,792 KB
testcase_35 AC 215 ms
55,952 KB
testcase_36 AC 208 ms
57,680 KB
testcase_37 AC 207 ms
55,800 KB
testcase_38 AC 206 ms
57,860 KB
testcase_39 AC 207 ms
56,104 KB
testcase_40 AC 183 ms
56,108 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++){
			double u = Math.pow(10 , 9) / (i * Math.pow(i + 1 , x));
			if(u > 0) q += u;
		}
		if(q - (int)q < 0.01) q--;
		if(q - (int)q > 0.99) q++;
		q /= 1000;
		ou.println((int)q);
		sc.close();
		ou.flush();
	}
}
0