結果
問題 |
No.1273 はじめのζ関数
|
ユーザー |
![]() |
提出日時 | 2020-10-31 00:18:50 |
言語 | Java (openjdk 23) |
結果 |
TLE
|
実行時間 | - |
コード長 | 471 bytes |
コンパイル時間 | 2,023 ms |
コンパイル使用メモリ | 74,428 KB |
実行使用メモリ | 61,124 KB |
最終ジャッジ日時 | 2024-07-22 04:00:31 |
合計ジャッジ時間 | 9,855 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 1 |
other | AC * 2 TLE * 2 -- * 36 |
ソースコード
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 , 6) ; j++){ q -= Math.pow(10 , 6) / Math.pow(j + 1 , i); } } ou.println((int)q - 1); sc.close(); ou.flush(); } }