90 pts 求调
查看原帖
90 pts 求调
1244840
Fatsheep_110922楼主2024/8/3 11:25
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 998244353;
inline bool check(ll x)
{
	ll tmp = 0;
	while(x)
	{
		tmp += x % 10;
		x /= 10;
	}
	if(tmp <= 1) return false;
	for(ll i = 2;i <= tmp/i;++i)
	{
		if(tmp % i == 0) return false;
	}
	return true;
}
int main()
{
	ll l, r;
	unsigned long long res = 1;
	cin >> l >> r;
	ll x = sqrt(l), y = sqrt(r);
	for(ll i = 1;i <= y;++i)
	{
		if(l <= i*i && i*i <= r && check(i*i))
		{
			res *= i*i%MOD;
			res %= MOD;
		}
	}
	cout << res%MOD;
	return 0;
}

2024/8/3 11:25
加载中...