(55pts求助)与前人思想背道而驰
查看原帖
(55pts求助)与前人思想背道而驰
1069781
Lzj_qwq楼主2023/12/30 19:08
#include<iostream>
#define ull unsigned long long
using namespace std;
ull pow(ull a,ull b,ull mod)//快速幂
{
	if(b==0) return 1;
	if(b%2==1) return pow(a,b-1,mod)*a%mod;
	ull flag=pow(a,b/2,mod);
	return flag*flag%mod;
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	ull a,b,k; scanf("%llu%llu%llu",&a,&b,&k);
	if(a>b)
	{
		if(k%a==0&&k%b!=0) printf("2");
		else printf("1");
	}
	else cout<<pow(2,(k-k%a)/a-(k-k%b)/b,998244353);
	return 0;
}
2023/12/30 19:08
加载中...