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); +}