能过前七个点,后面全部TLE
查看原帖
能过前七个点,后面全部TLE
1284180
yyz0526楼主2024/3/17 12:11
#include <bits/stdc++.h>
using namespace std;
long long n,p,i,j;
bool a=false;
int main(){
	scanf("%lld",&n);
	for(i=n/2+1;i>=1;i--){
		if(n%i==0&&a==false){
			for(j=2;j<i;j++){
				if(i%j==0){
				    a=true;
				   	break;
				} 
				if(j=i-1&&i%j!=0){
					printf("%lld",i);
					return 0;
				}
			}
		}
		a=false;
	} 
} 
2024/3/17 12:11
加载中...