結果

問題 No.2516 Credit Creation
ユーザー MasKoaTS
提出日時 2022-08-11 10:34:55
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 281 bytes
コンパイル時間 785 ms
コンパイル使用メモリ 66,516 KB
最終ジャッジ日時 2025-01-30 20:07:19
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#define rep(i, l, n) for (int i = (l); i < (n); i++)
using namespace std;


int main(void) {
	int n;	cin >> n;
	double r;	cin >> r;

	double ans = 0.0;
	double now = 100.0;
	rep(i, 0, n) {
		ans += now;
		now *= 1.0 - r;
	}

	printf("%.9f\n", ans);
	return 0;
}
0