結果
| 問題 |
No.1273 はじめのζ関数
|
| コンテスト | |
| ユーザー |
platinum
|
| 提出日時 | 2020-09-23 17:48:34 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 616 bytes |
| コンパイル時間 | 628 ms |
| コンパイル使用メモリ | 64,608 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-21 22:53:15 |
| 合計ジャッジ時間 | 1,969 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 39 WA * 1 |
ソースコード
#include <iostream>
#include <assert.h>
#define rep(i,n) for(int i=0; i<(int)(n); i++)
using namespace std;
using LL = long long;
const LL INF = 1e12;
const int Max_x = 1e4;
const int Max_a = 1e6;
double zeta(LL a, LL x){
LL res = a - 1;
rep(i,x - 1){
res *= a;
if(res > INF) break;
}
double d = res;
return 1 / d;
}
int main(){
LL x;
cin >> x;
assert(2 <= x and x <= Max_x);
double res = 0.0;
if(x == 2){
cout << 2000000 << endl;
}
else{
for(LL a = 2; a <= Max_a; a++) res += zeta(a, x);
res *= 1000000;
int ans = res;
cout << ans << endl;
}
return 0;
}
platinum