結果

問題 No.3362 積分!!!
コンテスト
ユーザー Tyto alba
提出日時 2025-11-19 23:17:05
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 492 bytes
コンパイル時間 827 ms
コンパイル使用メモリ 87,288 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-11-19 23:17:07
合計ジャッジ時間 1,796 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 6
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int main(){
    int n, x[2], i, j;
    long long fx;
    double ans[2] = {};
    vector<int> k;

    cin >> n >> x[0] >> x[1];

    for(i=0; i<=n; i++){
        cin >> j;
        k.push_back(j);
    }

    for(i=0; i<2; i++){
        for(j=n; j>=0; j--){
            ans[i] += (double)k[j] / (j + 1) * pow(x[i], j + 1);
        }
    }

    fx = ans[1] - ans[0];
    if (fx < 0) fx -= 1;
    cout << fx << endl;

}
0