結果
問題 |
No.1273 はじめのζ関数
|
ユーザー |
![]() |
提出日時 | 2020-10-31 00:19:19 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 471 bytes |
コンパイル時間 | 2,916 ms |
コンパイル使用メモリ | 75,752 KB |
実行使用メモリ | 47,132 KB |
最終ジャッジ日時 | 2024-07-22 04:01:48 |
合計ジャッジ時間 | 15,399 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 1 |
other | WA * 21 TLE * 1 -- * 18 |
ソースコード
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()); double q = Math.pow(10 , 6); for(int i = 2 ; i < x ; i++){ double p = 0; for(int j = 1 ; j <= Math.pow(10 , 5) ; j++){ q -= Math.pow(10 , 6) / Math.pow(j + 1 , i); } } ou.println((int)q - 1); sc.close(); ou.flush(); } }