結果
| 問題 |
No.1273 はじめのζ関数
|
| コンテスト | |
| ユーザー |
遭難者
|
| 提出日時 | 2020-10-31 00:29:44 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 238 ms / 2,000 ms |
| コード長 | 459 bytes |
| コンパイル時間 | 2,527 ms |
| コンパイル使用メモリ | 74,508 KB |
| 実行使用メモリ | 54,912 KB |
| 最終ジャッジ日時 | 2024-07-22 04:06:38 |
| 合計ジャッジ時間 | 12,230 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 40 |
ソースコード
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();
}
}
遭難者