結果
問題 |
No.1807 UMA Gacha
|
ユーザー |
![]() |
提出日時 | 2021-09-20 12:42:33 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 328 bytes |
コンパイル時間 | 819 ms |
コンパイル使用メモリ | 66,852 KB |
最終ジャッジ日時 | 2025-01-24 16:01:26 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 21 |
ソースコード
#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 p; cin >> p; if (n >= 200) { cout << 1 << endl; return 0; } double ans = 0.0; double t = 1.0; rep(i, 0, n) { ans += t * p; t *= 1 - p; } cout << ans << endl; return 0; }