結果
| 問題 |
No.1273 はじめのζ関数
|
| コンテスト | |
| ユーザー |
遭難者
|
| 提出日時 | 2020-10-31 00:28:45 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 507 bytes |
| コンパイル時間 | 2,130 ms |
| コンパイル使用メモリ | 74,932 KB |
| 実行使用メモリ | 61,760 KB |
| 最終ジャッジ日時 | 2024-07-22 04:05:45 |
| 合計ジャッジ時間 | 15,246 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 1 |
| other | AC * 1 WA * 20 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++){
for(int j = 1 ; j <= Math.pow(10 , 5) ; j++){
q -= Math.pow(10 , 6) / Math.pow(j + 1 , i);
}
}
if(x == 2) ou.println((int)Math.pow(10 , 6));
else ou.println((int)q - 1);
sc.close();
ou.flush();
}
}
遭難者