听说灌水大佬多,求助大佬!!!
  • 板块灌水区
  • 楼主_Monody_
  • 当前回复8
  • 已保存回复8
  • 发布时间2024/10/5 12:41
  • 上次更新2024/10/5 15:12:32
查看原帖
听说灌水大佬多,求助大佬!!!
1388115
_Monody_楼主2024/10/5 12:41

题目

Code

#include<bits/stdc++.h>
using  namespace std;
int main() {
	unsigned long long l,r,n,s,ans=1,a; 
	bool t;
	cin>>l>>r;
	for(int i=1; i<=1000000; i++){
		n=i*i;	
		a=n;	
		if(n>=l&&n<=r){
			s=0;
		while(a){
			s+=a%10;
			a/=10;
		}
		t=true;
		for(int j=2; j<s; j++)
			if(s%j==0)t=false;
		if(t)
			ans=ans*n;
		}
	}
	if(ans>1)cout<<ans%998244353;
	else cout<<0;
	return 0;
}

能麻烦各位大佬帮我调一下吗,就10分~

2024/10/5 12:41
加载中...