結果

問題 No.3362 積分!!!
コンテスト
ユーザー テナガザル
提出日時 2025-11-17 21:10:14
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 511 bytes
コンパイル時間 1,019 ms
コンパイル使用メモリ 113,484 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-11-17 21:10:16
合計ジャッジ時間 1,915 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 6
other AC * 9 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

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

using namespace std;

int main()
{
  int n, a, b;
  cin >> n >> a >> b;
  vector<double> k(n + 1);
  for (int i = 0; i <= n; ++i) cin >> k[i];
  double ans = 0;
  for (int i = 0; i <= n; ++i)
  {
    double tmp = k[i] / (i + 1);
    for (int j = 0; j <= i; ++j) tmp *= b;
    ans += tmp;
    tmp = k[i] / (i + 1);
    for (int j = 0; j <= i; ++j) tmp *= a;
    ans -= tmp;
  }
  if (ans < 0) ans -= 0.9999;
  printf("%.0lf\n", ans);
}
0