結果
| 問題 |
No.1272 珍しい級数
|
| コンテスト | |
| ユーザー |
higopon_
|
| 提出日時 | 2020-10-30 22:03:05 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 658 bytes |
| コンパイル時間 | 1,466 ms |
| コンパイル使用メモリ | 167,096 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-22 00:39:30 |
| 合計ジャッジ時間 | 2,710 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 50 |
ソースコード
#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 k;
cin>>k;
double ans=0;
if(k==0){
cout<<0<<endl;
return 0;
}
for(int i=1;i<=100;i++){
double tmp=sin(k*i)/pow(i,i);
//cout<<tmp<<" "<<ans<<endl;
if(abs(tmp)<0.000000001){
break;
}
ans+=tmp;
}
cout<<setprecision(10)<<ans<<endl;
return 0;
}
higopon_