全是TLE,有大神能帮一下吗?
查看原帖
全是TLE,有大神能帮一下吗?
1634829
achild楼主2025/1/25 17:05

求大神解决

#include<iostream>
using namespace std;
int b[100001];
int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		int a;
		cin>>a;
		bool t=0;
		for(int j=1;j<a/2;j++)
		{
			if(j*j*j*j == a)
			{
				cout<<j<<endl;
				t=1;
			}
		}
		if(t==0)
		{
			cout<<-1<<endl;
		}
	}
	return 0;
}
	}
	if(t==0)
	{
		cout<<-1<<endl;
	}
}
return 0;

}

2025/1/25 17:05
加载中...