結果

問題 No.1273 はじめのζ関数
ユーザー kyoprounokyoprouno
提出日時 2020-10-30 22:21:33
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,879 bytes
コンパイル時間 1,736 ms
コンパイル使用メモリ 175,296 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-29 06:45:30
合計ジャッジ時間 3,388 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 1 ms
4,380 KB
testcase_23 AC 1 ms
4,376 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 1 ms
4,376 KB
testcase_26 AC 1 ms
4,380 KB
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 1 ms
4,376 KB
testcase_29 AC 1 ms
4,376 KB
testcase_30 AC 2 ms
4,376 KB
testcase_31 AC 1 ms
4,376 KB
testcase_32 AC 2 ms
4,380 KB
testcase_33 AC 1 ms
4,376 KB
testcase_34 AC 1 ms
4,380 KB
testcase_35 AC 1 ms
4,376 KB
testcase_36 AC 1 ms
4,376 KB
testcase_37 AC 2 ms
4,380 KB
testcase_38 AC 1 ms
4,376 KB
testcase_39 AC 1 ms
4,380 KB
testcase_40 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize("O3")
#include <algorithm>

#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pii pair<int,int>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define endl '\n'
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

using namespace std;



template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}

const int INF=1e9;

const double pi=acos(-1);

int main(){
    int x;
    cin >> x;
    vector<long double> p(32);
    p[2]=644934.0668;
    p[3]=202056.9032;
    p[4]=82323.23371;
    p[5]=36927.75514;
    p[6]=17343.06198;
    p[7]=8349.277382;
    p[8]=4077.356198;
    p[9]=2008.392826;
    p[10]=994.5751278;
    p[11]=494.1886041;
    p[12]=246.0865533;
    p[13]=122.7133476;
    p[14]=61.24813506;
    p[15]=30.58823631;
    p[16]=15.28225941;
    p[17]=7.637197638;
    p[18]=3.817293265;
    p[19]=1.908212717;
    p[20]=0.9539620339;
    p[21]=0.4769329868;
    p[22]=0.2384505027;
    p[23]=0.119219926;
    p[24]=0.05960818905;
    p[25]=0.02980350352;
    p[26]=0.01490155483;
    p[27]=0.00745071179;
    p[28]=0.003725334025;
    p[29]=0.001862659724;
    p[30]=0.0009313274324;
    p[31]=0.0004656629065;
    if(x==2){
        cout << 1000000<< endl;
        return 0;
    }
    if(x>31){
        cout << 0 << endl;
    }
    else{
        long double ans=0.0;
        for(int i=x;i<=31;i++){
            ans+=p[i];
            
        }
        int val=ans;
        cout << setprecision(30) << fixed;
        //cout << ans << endl;
        cout << val << endl;
    }
    
    return 0;
}
0