就是选择c
首先由c种选择
时间=wa+最后ac+前中ac
wa:5*c*a
最后ac:5*c(a+b+1)
前中ac:
由于前中每个位置挑选没有特殊性,所以每个位置分得的次数是一样的
平均每个位置分得的次数:b/(a+b)
平均每个位置的罚时:(a+b+1)(a+b)/2
前中ac所占的罚时:
所有情况的时间相加/情况数:
所以只要判断是否可以被2除
#include <bits/stdc++.h>
using namespace std;
const int mod=998244853;
typedef long long ll;
ll a,b,motherTwo=1,ans;
void find2(){
ll a=2,b=mod-2;
while(b){
if(b&1) motherTwo*=a, motherTwo%=mod;
b>>=1, a*=a, a%=mod;
}
}
int main(int argc, char** argv) {
find2();
cin>>a>>b;
a%=mod, b%=mod;
ans=(((a<<2)%mod+(b<<1)%mod)%mod+2+((a+b)%mod+1)%mod*b%mod)%mod;
ans=ans*5%mod;
if(ans%2==0) cout<<ans/2<<endl;
else{
ans=ans*motherTwo%mod;
cout<<ans<<endl;
}
return 0;
} 
京公网安备 11010502036488号