結果
| 問題 |
No.1273 はじめのζ関数
|
| コンテスト | |
| ユーザー |
platinum
|
| 提出日時 | 2020-09-21 17:29:43 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 660 bytes |
| コンパイル時間 | 749 ms |
| コンパイル使用メモリ | 69,504 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-21 22:52:33 |
| 合計ジャッジ時間 | 2,076 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 40 |
ソースコード
#include <iostream>
#include <iomanip>
#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 = 1e5;
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 ans = 0.0;
if(x == 2){
cout << "y" << endl;
cout << 2 << endl;
}
else{
for(LL a = 2; a <= Max_a; a++) ans += zeta(a, x);
cout << "m" << endl;
cout << setprecision(15) << ans << endl;
}
return 0;
}
platinum