結果
| 問題 |
No.1807 UMA Gacha
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-14 21:48:16 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 566 bytes |
| コンパイル時間 | 763 ms |
| コンパイル使用メモリ | 77,524 KB |
| 最終ジャッジ日時 | 2025-01-27 11:16:19 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 21 |
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i=0;i < (int)(n);i++)
void slove(){
int n;
double p;
cin >> n >> p;
if (n >= 200) {
cout << 1.0000000 << endl;
return;
}
else{
double ans = 1.0;
double tmp = 1.0;
for (int i = 0; i < n;i++){
tmp *= (1-p);
}
printf("%.8f\n",ans-tmp);
}
}
int main(){
int tt = 1;
//cin >> tt;
while(tt--){
slove();
}
return 0;
}