結果
問題 | No.1807 UMA Gacha |
ユーザー |
![]() |
提出日時 | 2021-09-20 12:39:15 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 325 bytes |
コンパイル時間 | 757 ms |
コンパイル使用メモリ | 66,796 KB |
最終ジャッジ日時 | 2025-01-24 16:01:23 |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 WA * 1 |
ソースコード
#include <iostream>#define rep(i, l, n) for (int i = (l); i < (n); i++)using namespace std;int main(void) {int n; cin >> n;float p; cin >> p;if (n >= 200) {cout << 1 << endl;return 0;}float ans = 0.0;float t = 1.0;rep(i, 0, n) {ans += t * p;t *= 1 - p;}cout << ans << endl;return 0;}