标签:简单 inf ons a* long 比较 span mod bit
9999999 1000000000000000000 899999999999777777
348456814
题解:
纯数学题,用二项式定理化简公式就行了,比较简单。
下面是详细过程:
#include<bits/stdc++.h> #define ll long long using namespace std; const ll mod=998244353LL; ll n,s,d; ll mul(ll a,ll b){return a%mod*(b%mod)%mod;} ll ksm(ll a,ll b){ a%=mod;ll ret=1LL; while(b){ if(b&1)ret=ret*a%mod; a=a*a%mod,b>>=1; } return ret; } int main() { scanf("%lld%lld%lld",&n,&s,&d); printf("%lld",(mul(s,ksm(2LL,n))+mul(mul(n,d),ksm(2LL,n-1)))%mod); }
标签:简单 inf ons a* long 比较 span mod bit
原文地址:https://www.cnblogs.com/hsylovefl/p/9734438.html