結果
問題 |
No.347 微分と積分
|
ユーザー |
|
提出日時 | 2024-09-19 23:31:33 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 518 bytes |
コンパイル時間 | 1,900 ms |
コンパイル使用メモリ | 195,868 KB |
最終ジャッジ日時 | 2025-02-24 09:35:42 |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 WA * 3 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int N; double B; cin>>N>>B; vector<double> A(N); for(int i=0;i<N;i++)cin>>A[i]; double an=0.0,bn=0.0; for(int i=0;i<N;i++){ an+=A[i]*pow(B,A[i]-1); if(abs(A[i]+1.0)<0.2){ bn+=log(B); } else{ bn+=1.0/(A[i]+1)*pow(B,A[i]+1); } } cout<<fixed<<setprecision(15)<<an<<"\n"<<bn<<endl; }