結果
| 問題 |
No.1273 はじめのζ関数
|
| コンテスト | |
| ユーザー |
Ilag
|
| 提出日時 | 2020-10-30 22:26:17 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 621 bytes |
| コンパイル時間 | 1,702 ms |
| コンパイル使用メモリ | 165,716 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-22 01:37:59 |
| 合計ジャッジ時間 | 3,415 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 39 WA * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1001001001;
const long long MOD = 1000000007;
const double EPS = 1e-10;
long double riemann_zeta(long double i){
long double res=0;
for(ll j=1;;j++){
long double t=1.0/pow(j,i);
if(t<1e-15)break;
res+=t;
}
return res;
}
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
ll x;
cin>>x;
long double sum=0;
for(ll i=x;;i++){
long double t=riemann_zeta(i)-1.0;
if(t<1e-15)break;
sum+=t;
}
ll ans=floor(sum*1e6);
cout<<ans<<endl;
}
Ilag