为啥TLE4个点
查看原帖
为啥TLE4个点
988515
YSchencheche楼主2023/11/8 14:03
#include<bits/stdc++.h>
using namespace std;
bool p(int e)
{
	for(int i=2;i<=sqrt(e);i++)
	{
		if(!(e%i))
		{
			return 0;
		}
	}
	return 1;
}
int main()
{
	int a,b;
	cin>>a>>b;
	for(int i=a;i<=b;i++)
	{
		stringstream Q;
		Q<<i;
		string q;
		Q>>q;
		string w =q;
		reverse(q.begin(),q.end());
		if(p(i) && q==w)
		{
			cout<<i<<"\n";
		}
	}
	return 0;
} 

请问为啥??

2023/11/8 14:03
加载中...