結果
| 問題 |
No.1807 UMA Gacha
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-03-20 18:23:51 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 396 bytes |
| コンパイル時間 | 4,327 ms |
| コンパイル使用メモリ | 249,792 KB |
| 最終ジャッジ日時 | 2025-02-20 08:14:24 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 21 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;
int main() {
int n;
ld p, res = 1, ans = 0;
cin >> n >> p;
if (n >= 200) ans = 1;
else {
for (int i = 0; i < n; i++) {
res *= (ld)1 - p;
}
ans = (ld)1 - res;
}
cout << fixed << setprecision(15) << ans << endl;
return 0;
}