結果
問題 | No.1235 ζ関数 |
ユーザー | クケ |
提出日時 | 2020-10-16 16:05:02 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 7 ms / 2,000 ms |
コード長 | 2,925 bytes |
コンパイル時間 | 751 ms |
コンパイル使用メモリ | 95,124 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-20 20:50:38 |
合計ジャッジ時間 | 2,168 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 5 ms
5,248 KB |
testcase_01 | AC | 6 ms
5,376 KB |
testcase_02 | AC | 6 ms
5,376 KB |
testcase_03 | AC | 7 ms
5,376 KB |
testcase_04 | AC | 5 ms
5,376 KB |
testcase_05 | AC | 7 ms
5,376 KB |
testcase_06 | AC | 6 ms
5,376 KB |
testcase_07 | AC | 7 ms
5,376 KB |
testcase_08 | AC | 7 ms
5,376 KB |
testcase_09 | AC | 7 ms
5,376 KB |
testcase_10 | AC | 7 ms
5,376 KB |
testcase_11 | AC | 6 ms
5,376 KB |
testcase_12 | AC | 6 ms
5,376 KB |
testcase_13 | AC | 7 ms
5,376 KB |
testcase_14 | AC | 6 ms
5,376 KB |
testcase_15 | AC | 7 ms
5,376 KB |
testcase_16 | AC | 5 ms
5,376 KB |
testcase_17 | AC | 6 ms
5,376 KB |
testcase_18 | AC | 6 ms
5,376 KB |
testcase_19 | AC | 6 ms
5,376 KB |
testcase_20 | AC | 6 ms
5,376 KB |
コンパイルメッセージ
main.cpp: In function 'long long int lcm(std::vector<long long int>)': main.cpp:74:145: warning: 'n' may be used uninitialized [-Wmaybe-uninitialized] 74 | ll lcm(vector<ll> a){ll n;rep(i,1,a.size()){n=a[i-1]*a[i];ll k=a[i-1]%a[i];while(k!=0){a[i-1]=a[i];a[i]=k;k=a[i-1]%a[i];}n/=a[i];a[i]=n;}return n;} | ^ main.cpp:74:25: note: 'n' was declared here 74 | ll lcm(vector<ll> a){ll n;rep(i,1,a.size()){n=a[i-1]*a[i];ll k=a[i-1]%a[i];while(k!=0){a[i-1]=a[i];a[i]=k;k=a[i-1]%a[i];}n/=a[i];a[i]=n;}return n;} | ^
ソースコード
#include<iostream> #include<algorithm> #include<string> #include<iomanip> #include<cmath> #include<vector> #include<deque> #include<queue> #include<map> #include<set> #include<list> #define ll long long #define str string #define ld long double #define vec vector #define vll vec<ll> #define vvll vec<vll> #define rep(i,a,b) for(ll i=a;i<b;i++) #define rrep(i,b,a) for(ll i=b;i>=a;i--) #define repset(itr,a) for(auto itr=a.begin();itr!=a.end();itr++) #define repnck(bit,n,k) for(ll bit=(1<<(k))-1;bit<(1<<(n));bit=nec(bit)) #define bi1(bit,i) ((bit)&1<<(i)?true:false) #define all(a) a.begin(),a.end() #define rall(a) a.rbegin(),a.rend() #define kai "\n" #define prque priority_queue #define pub push_back #define pob pop_back #define puf push_front #define pof pop_front #define mie min_element #define mae max_element #define tos to_string #define sep setprecision #define lob lower_bound #define upb upper_bound #define bis binary_search #define nep next_permutation #define MOD 1000000007ll #define MAX 2147483647 #define MIN (1e-10) #define equal(a,b) (abs((a)-(b))<MIN) using namespace std; void solve(); struct ll2{ll x,y;bool operator<(const ll2 &l)const{return x!=l.x?x<l.x:y<l.y;};}; struct ll3{ll x,y,z;bool operator<(const ll3 &l)const{if(x!=l.x)return x<l.x;if(y!=l.y)return y<l.y;return z<l.z;};}; class ufset{ public: ufset(ll n) {rank.resize(n,0);rep(i,0,n)p.pub(i);} bool same(ll i,ll j){return find(i)==find(j);} void unite(ll i,ll j){link(find(i),find(j));} private: vll rank,p; void link(ll i,ll j){if(rank[i]>rank[j])p[j]=i;else{p[i]=j;if(rank[i]==rank[j])rank[j]++;}} ll find(ll i){if(i!=p[i])p[i]=find(p[i]);return p[i];} }; class nck{ public: nck(ll maxn,ll mod=MOD){ NUM=maxn+1;p=mod; fac.resize(NUM);finv.resize(NUM);inv.resize(NUM); fac[0]=fac[1]=finv[0]=finv[1]=inv[1]=1; rep(i,2,NUM){fac[i]=fac[i-1]*i%p;inv[i]=p-inv[p%i]*(p/i)%p;finv[i]=finv[i-1]*inv[i]%p;} } ll c(ll n,ll k){return fac[n]*(finv[k]*finv[n-k]%p)%p;} private: ll NUM,p; vll fac,finv,inv; }; ll gcd(vector<ll> a){rep(i,1,a.size()){ll k=a[i-1]%a[i];while(k!=0){a[i-1]=a[i];a[i]=k;k=a[i-1]%a[i];}}return a.back();} ll lcm(vector<ll> a){ll n;rep(i,1,a.size()){n=a[i-1]*a[i];ll k=a[i-1]%a[i];while(k!=0){a[i-1]=a[i];a[i]=k;k=a[i-1]%a[i];}n/=a[i];a[i]=n;}return n;} ll pow2(ll a,ll b,ll p=MOD){if(b==-1)return pow2(a,p-2);ll res=1;if(b>0){res=pow2(a,b/2);if(b%2==0)res=res*res%p;else res=res*res%p*a%p;}return res;} ll nec(ll bit){ll x=bit&-bit,y=bit+x;return (((bit&~y)/x)>>1)|y;} ll bisz(ll bit){ll size=0;while(bit>0){bit/=2;size++;}return size;} ll ransu(){static unsigned int TX=123456789, TY=362436069, TZ=521288629, TW=88675123;unsigned int tt=(TX^(TX<<11));TX=TY;TY=TZ;TZ=TW;return (TW=(TW^(TW>>19))^(tt^(tt>>8)));} int main(){ cin.tie(0); ios::sync_with_stdio(false); cout<<fixed; solve(); } void solve(){ ll n;cin>>n; ld ans=0,ii=1; rep(i,1,10000){ ans+=pow(ii*i,-ii*n); } cout<<ans<<kai; }