結果
問題 | No.1273 はじめのζ関数 |
ユーザー |
![]() |
提出日時 | 2020-10-30 22:18:33 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,876 bytes |
コンパイル時間 | 1,873 ms |
コンパイル使用メモリ | 176,932 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-22 01:08:10 |
合計ジャッジ時間 | 3,011 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | AC * 25 WA * 15 |
ソースコード
#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==7){cout << 16415 << 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;}