結果

問題 No.347 微分と積分
ユーザー aaaaaaiu
提出日時 2019-08-14 23:20:40
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 346 bytes
コンパイル時間 2,094 ms
コンパイル使用メモリ 193,708 KB
最終ジャッジ日時 2025-01-07 11:50:19
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 18 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int n,b;
    cin>>n>>b;
    double a[n];
    for (int i=0;i<n;i++) cin>>a[i];
    double f=0;
    double F=0;
    for (int i=0;i<n;i++) {
        f+=a[i]*pow(b,a[i]-1);
        F+=pow(b,a[i]+1)/(a[i]+1);
    }
    cout<<fixed<<f<<endl<<F<<endl;
    return 0;
}
0