結果
問題 | No.1273 はじめのζ関数 |
ユーザー |
![]() |
提出日時 | 2020-10-30 22:20:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 732 bytes |
コンパイル時間 | 1,622 ms |
コンパイル使用メモリ | 166,320 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-22 01:14:34 |
合計ジャッジ時間 | 2,791 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 38 WA * 2 |
ソースコード
#include<bits/stdc++.h>#define _GLIBCXX_DEBUGusing namespace std;#define rep(i,n) for(int i=0;i<(n);i++)#define all(v) v.begin(),v.end()#define PI acos(-1)typedef long long ll;ll MOD=1000000007;ll gcd(ll x,ll y){if(y==0) return x;else return gcd(y,x%y);}ll lcm(ll x,ll y){return x/gcd(x,y)*y;}int main(){int x;cin>>x;double ans=0;for(int i=x;i<=100000000;i++){double tmp=0;for(int j=1;j<=100000000;j++){double t=1/pow(j,i);tmp+=t;if(t<0.000000001){break;}}tmp--;ans+=tmp;if(tmp<0.000000001){break;}}ans*=1000000;ans=floor(ans);cout<<ans<<endl;return 0;}