結果

問題 No.3362 積分!!!
コンテスト
ユーザー areik
提出日時 2025-11-17 21:04:38
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 903 bytes
コンパイル時間 3,841 ms
コンパイル使用メモリ 251,408 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-11-17 21:04:43
合計ジャッジ時間 4,584 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 6
other AC * 9 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;

using isize = size_t;
using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;
using i128 = __int128_t;
using u128 = __uint128_t;
using f64 = long double;
using p2 = pair<i64, i64>;
using el = tuple<i64, i64, i64>;
using mint = atcoder::modint998244353;

void _main();
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(18);
  _main();
}

void _main() {
  i64 n, a, b;
  cin >> n >> a >> b;
  vector<i64> k(n + 1);
  i64 x = 0, y = 1;
  for (i64 i = 0; i <= n; i++) {
    cin >> k[i];
    // k[i] / (i + 1) * t^(i + 1)
    i64 u = 1, v = 1;
    for (i64 j = 0; j < i + 1; j++) u *= a, v *= b;
    x *= i + 1, y *= i + 1;
    x += y / (i + 1) * (v - u) * k[i];
  }
  if (x < 0) {
    cout << -(-x / y) << "\n";
    return;
  }
  cout << x / y << "\n";
}
0