結果
問題 |
No.2516 Credit Creation
|
ユーザー |
|
提出日時 | 2024-01-22 21:18:29 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 343 bytes |
コンパイル時間 | 612 ms |
コンパイル使用メモリ | 77,632 KB |
最終ジャッジ日時 | 2025-02-18 22:10:22 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 10 |
ソースコード
#include<iostream> #include<vector> #include<iomanip> using namespace std; int main(){ double n,r; cin >> n >> r; vector<double> v(n + 1); v[1] = 100; for(int i = 1;i < n;i++){ v[i + 1] = (1 - r) * v[i]; v[i] *= r; } double ans = 0; for(int i = 1;i <= n;i++){ ans += v[i]; } cout << fixed << setprecision(20) << ans << endl; }