From 9e31c5012207a4e69cab539d125bb7c4a9dd5284 Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Sat, 13 Aug 2016 16:41:04 +0800 Subject: [PATCH] Create 100819L.cpp --- Codeforces/Gym/100819L.cpp | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Codeforces/Gym/100819L.cpp diff --git a/Codeforces/Gym/100819L.cpp b/Codeforces/Gym/100819L.cpp new file mode 100644 index 0000000..7131622 --- /dev/null +++ b/Codeforces/Gym/100819L.cpp @@ -0,0 +1,41 @@ +#include +#include +#include +#include + +#include +using namespace std; +#define MAXROUND 100005 +double safemoney[MAXROUND]; +double roundmoney[MAXROUND]; +double p[MAXROUND]; +char str[256]; +inline double ln(double inc) +{ + return log(inc); +} +int main() +{ + int n,W; + scanf("%d %d",&n,&W); + for(int i=0;i=0;i--) + { + double tmp=p[i]*roundmoney[i+1]+(1-p[i])*safemoney[i]; + roundmoney[i]=max(tmp,roundmoney[i]); + } + double ans=(exp(roundmoney[0])-1)*W; + printf("$%.2f\n",ans); +}