結果

問題 No.1807 UMA Gacha
ユーザー Digwee_kkknDigwee_kkkn
提出日時 2022-01-14 21:48:20
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,002 bytes
コンパイル時間 1,989 ms
コンパイル使用メモリ 167,464 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-30 14:04:11
合計ジャッジ時間 2,373 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,948 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 AC 2 ms
6,944 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 2 ms
6,944 KB
testcase_15 AC 2 ms
6,944 KB
testcase_16 AC 2 ms
6,940 KB
testcase_17 AC 2 ms
6,944 KB
testcase_18 AC 2 ms
6,944 KB
testcase_19 AC 2 ms
6,940 KB
testcase_20 AC 2 ms
6,940 KB
testcase_21 AC 2 ms
6,944 KB
testcase_22 AC 2 ms
6,944 KB
testcase_23 AC 2 ms
6,944 KB
testcase_24 AC 2 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>  
#define _USE_MATH_DEFINES       
using namespace std;  
typedef long long ll;  typedef float fl; typedef double db; typedef bool bl; 
typedef string st;  typedef pair<int,int> P; typedef int itn;
const int INF=100000000;  const ll INFx=1000000000000; ll MOD=1000000007;
int dx[4]={1,0,-1,0} , dy[4]={0,1,0,-1}; int DX[8]={0,-1,-1,-1,0,1,1,1} , DY[8]={1,1,0,-1,-1,-1,0,1}; 
string fi="01234567890123456789"; string al="abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"; string AL="ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ";
int factorial(int i){return i ? factorial(i-1)*i:1;};    
#define rep(i,n) for(int i=0;i<(n);++i)  
#define YesNo(flag) if(flag){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}

int main(){
 int n;cin>>n; fl p; cin>>p;
 if(n>=200){cout<<1;return 0;}
 fl v=0,ans=p;
 rep(i,n-1){
   v=(1-ans)*p;
   ans+=v;
   v=0;
 }
 cout<<fixed<<setprecision(6)<<ans<<endl;
}

                                                                                
0