Kanade has n boxes , the i-th box has p[i] probability to have an diamond of d[i] size. At the beginning , Kanade has a diamond of 0 size. She will open the boxes from 1-st to n-th. When she open a box,if there is a diamond in it and it's bigger than the diamond of her , she will replace it with her diamond. Now you need to calculate the expect number of replacements. You only need to output the answer module 998244353. Notice: If x%998244353=y*d %998244353 ,then we denote that x/y%998244353 =d%998244353
Kanade has n boxes , the i-th box has p[i] probability to have an diamond of d[i] size. At the beginning , Kanade has a diamond of 0 size. She will open the boxes from 1-st to n-th. When she open a box,if there is a diamond in it and it's bigger than the diamond of her , she will replace it with her diamond. Now you need to calculate the expect number of replacements. You only need to output the answer module 998244353. Notice: If x%998244353=y*d %998244353 ,then we denote that x/y%998244353 =d%998244353
标签: HBC17412take题解