結果

問題 No.1272 珍しい級数
ユーザー logxlogx
提出日時 2020-09-20 17:21:18
言語 C++14
(gcc 11.2.0 + boost 1.78.0)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 1,288 bytes
コンパイル時間 1,688 ms
使用メモリ 8,368 KB
最終ジャッジ日時 2023-02-20 15:33:41
合計ジャッジ時間 10,295 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 1 ms
8,360 KB
testcase_01 AC 67 ms
7,596 KB
testcase_02 AC 136 ms
8,260 KB
testcase_03 AC 66 ms
7,656 KB
testcase_04 AC 67 ms
7,648 KB
testcase_05 AC 129 ms
8,212 KB
testcase_06 AC 134 ms
8,236 KB
testcase_07 AC 138 ms
7,656 KB
testcase_08 AC 130 ms
8,240 KB
testcase_09 AC 138 ms
8,244 KB
testcase_10 AC 139 ms
8,236 KB
testcase_11 AC 135 ms
8,252 KB
testcase_12 AC 139 ms
8,240 KB
testcase_13 AC 136 ms
8,252 KB
testcase_14 AC 138 ms
7,680 KB
testcase_15 AC 138 ms
7,596 KB
testcase_16 AC 139 ms
8,240 KB
testcase_17 AC 133 ms
8,224 KB
testcase_18 AC 137 ms
8,368 KB
testcase_19 AC 136 ms
8,244 KB
testcase_20 AC 136 ms
7,576 KB
testcase_21 AC 135 ms
8,256 KB
testcase_22 AC 138 ms
8,316 KB
testcase_23 AC 136 ms
8,240 KB
testcase_24 AC 134 ms
7,572 KB
testcase_25 AC 139 ms
8,300 KB
testcase_26 AC 135 ms
7,608 KB
testcase_27 AC 136 ms
7,604 KB
testcase_28 AC 135 ms
8,244 KB
testcase_29 AC 136 ms
7,672 KB
testcase_30 AC 136 ms
7,576 KB
testcase_31 AC 135 ms
7,652 KB
testcase_32 AC 137 ms
7,660 KB
testcase_33 AC 133 ms
8,296 KB
testcase_34 AC 135 ms
7,592 KB
testcase_35 AC 139 ms
7,596 KB
testcase_36 AC 137 ms
8,312 KB
testcase_37 AC 137 ms
8,328 KB
testcase_38 AC 137 ms
7,596 KB
testcase_39 AC 137 ms
8,224 KB
testcase_40 AC 137 ms
7,584 KB
testcase_41 AC 137 ms
7,724 KB
testcase_42 AC 136 ms
8,252 KB
testcase_43 AC 136 ms
8,212 KB
testcase_44 AC 134 ms
7,668 KB
testcase_45 AC 138 ms
8,248 KB
testcase_46 AC 136 ms
8,300 KB
testcase_47 AC 139 ms
7,584 KB
testcase_48 AC 139 ms
8,300 KB
testcase_49 AC 137 ms
8,300 KB
testcase_50 AC 137 ms
8,240 KB
testcase_51 AC 134 ms
7,728 KB
testcase_52 AC 137 ms
8,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#define _GLIBCXX_DEBUG
#endif
using 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 vector
typedef 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=1
    if(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=1
    if(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;
}
0