結果
問題 | No.1272 珍しい級数 |
ユーザー |
![]() |
提出日時 | 2020-09-20 17:21:18 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 101 ms / 2,000 ms |
コード長 | 1,288 bytes |
コンパイル時間 | 1,675 ms |
コンパイル使用メモリ | 167,248 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-21 07:52:38 |
合計ジャッジ時間 | 8,113 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 50 |
ソースコード
#include <bits/stdc++.h>#ifndef ONLINE_JUDGE#define _GLIBCXX_DEBUG#endifusing namespace std;#define rep(i, n) for (int i = 0; i < (int)(n); i++)#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)#define Clear(a) a = decltype(a)()#define all(a) a.begin(),a.end()#define rall(a) a.rbegin(),a.rend()#define vec vectortypedef long long ll;typedef pair<ll,ll> P;//const ll big=998244353;const ll big=1000000007LL;const ll INF=1e18;const int dx[4]={1,0,-1,0};const int dy[4]={0,1,0,-1};ll max(ll x,ll y){if(x>y)return x;else return y;}ll min(ll x,ll y){if(x<y)return x;else return y;}ll expm(ll x,ll y){if(y==0)return 1;//0^0=1if(x==1||x==0)return x;if(y%2==1)return (expm(x,y-1)*x)%big;ll t=expm(x,y/2);return (t*t)%big;}ll exp(ll x,ll y){if(y==0)return 1;//0^0=1if(x==1||y==0)return x;if(y%2==1)return exp(x,y-1)*x;ll t=exp(x,y/2);return t*t;}double solve(){int k;cin >> k;if(k==0)return 0;double res=0;rep2(i,1,1000000){res+=sin(k*i)/pow(i*1.0,i);}return res;}int main(){ios::sync_with_stdio(false);std::cin.tie(nullptr);cout << fixed << setprecision(10);/*--------------------------------*/cout << solve() << endl;}