結果
| 問題 |
No.1273 はじめのζ関数
|
| コンテスト | |
| ユーザー |
higopon_
|
| 提出日時 | 2020-10-30 22:32:47 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 808 bytes |
| コンパイル時間 | 1,712 ms |
| コンパイル使用メモリ | 166,284 KB |
| 実行使用メモリ | 10,272 KB |
| 最終ジャッジ日時 | 2024-07-22 01:53:37 |
| 合計ジャッジ時間 | 5,503 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 1 |
| other | AC * 20 TLE * 1 -- * 19 |
ソースコード
#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
using 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;
long double ans=0.0;
for(int i=x;i<=MOD-7;i++){
long double tmp=0.0;
for(int j=1;j<=MOD-7;j++){
long double t=1.0/pow(j,i);
tmp+=t;
if(t<0.000000000000000001){
break;
}
}
tmp--;
ans+=tmp;
if(tmp<0.000000000000000001){
break;
}
}
//cout<<setprecision(10)<<ans<<endl;
ans*=1000000;
ll anss=floor(ans);
cout<<anss<<endl;
return 0;
}
higopon_