​原题链接​​​ 思路:
CF1265E Beautiful Mirrors (概率dp)_#include表示走到第CF1265E Beautiful Mirrors (概率dp)_#include_02个镜子的期望天数:
CF1265E Beautiful Mirrors (概率dp)_c++_03
当这个镜子说她漂亮时,只需要花费CF1265E Beautiful Mirrors (概率dp)_#include_04天;
否则,需要从起点重新开始,也就是CF1265E Beautiful Mirrors (概率dp)_#include
化简得:
CF1265E Beautiful Mirrors (概率dp)_i++_06
其中
CF1265E Beautiful Mirrors (概率dp)_#include_07 (x为输入的数)
注意求逆元的时候要用long long
代码:

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=2e5+100,mod=998244353;
ll n,p[maxn],dp[maxn];
ll ksm(ll a,ll b){
ll res=1;
while(b){
if(b&1) res=res*a%mod;
a=a*a%mod;
b>>=1;
}
return res;
}
int main(){
ll n;cin>>n;
dp[0]=0;
for(int i=1;i<=n;i++){
cin>>p[i];
}
for(int i=1;i<=n;i++){
dp[i]=(dp[i-1]+1)%mod*100%mod*ksm(p[i],mod-2)%mod;
}
cout<<dp[n]<<endl;
return 0;
}