結果
| 問題 |
No.3362 積分!!!
|
| コンテスト | |
| ユーザー |
AK_Mi
|
| 提出日時 | 2025-11-17 21:14:32 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 678 bytes |
| コンパイル時間 | 5,227 ms |
| コンパイル使用メモリ | 335,928 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-11-17 21:14:44 |
| 合計ジャッジ時間 | 6,055 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 6 |
| other | AC * 5 WA * 9 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;
int main(){
ld n,a,b;
cin >> n >> a >> b;
ld ans = 0;
vector<ld> aa(n+2,1);
vector<ld> bb(n+2,1);
for(ll i = 1; i < n+2; i++){
aa[i] = aa[i-1] * a;
bb[i] = bb[i-1] * b;
}
ld k;
ld waru = 1;
for(ll i = 0; i <= n; i++){
cin >> k;
ans += k * (bb[i+1] - aa[i+1]) / waru;
waru *= (i+2);
}
if(ans < 0){
if(ans - ll(ans) == 0)cout << ans << '\n';
else cout << ll(ans) - 1 << '\n';
}else cout << ll(ans) << '\n';
return 0;
}
AK_Mi