結果
問題 | No.1807 UMA Gacha |
ユーザー |
![]() |
提出日時 | 2024-11-30 16:01:57 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 343 bytes |
コンパイル時間 | 2,012 ms |
コンパイル使用メモリ | 199,308 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-30 16:02:03 |
合計ジャッジ時間 | 2,860 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 21 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main(){int n; cin >> n;double p; cin >> p;if(n >= 200){cout << 1 << endl;return 0;}double q = 1.0;for(int i = 0; i < n; ++i){q *= 1 - p;}double ans = 1 - q;cout << setprecision(16) << ans << endl;return 0;}