题目要求:
⌈25b×2a+2⌉×100mod998344353
所以问题在于:
std::ceil()
。轻喷楼主这个弱智。若能解答感恩不尽。
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cctype>
#include <cmath>
using namespace std;
typedef long long ll;
const ll MOD=998344353LL;
ll a,b;
ll _stoi(string s)
{
ll res=0;
for(auto ch:s)
res=(res*10+int(ch-'0'))%MOD;
return res%MOD;
}
ll qpow(ll base,ll k)
{
ll res=1;
while(k)
{
if(k&1)
res=res*base%MOD;
k>>=1;
base=base*base%MOD;
}
return res%MOD;
}
int main()
{
ios::sync_with_stdio(false);
string st;cin>>st>>a;
b=_stoi(st);
ll tmp=b*qpow(2,a+2)%MOD;
ll i=0;
for(;i<=24;i++)
if((tmp+i)%25LL==0)
{
tmp+=i;
break;
}
cout<<(tmp*4%MOD)<<endl;
// ll ans=(ll)(ceil(tmp/25.0))*100LL%MOD;
// cout<<ans<<endl;
return 0;
}