1 条题解

  • 0
    @ 2025-3-9 11:44:21
    #include<bits/stdc++.h>
    using namespace std;
    
    typedef long long ll;
    const int N = 1e6+5,P=7;
    const int inf = 0x3f3f3f3f;
    
    ll gcd(ll a,ll b){
    	return b==0? a: gcd(b, a%b);
    }
    bool isp(int n){
    	for(int i=2; i<=n/i; i++) if(n%i==0) return 0;
    	return n > 1;
    } 
    
    void solve(){
    	int n; cin>>n;
    	for(int i=2; i<=n/i; i++){
    		int b = n/i;
    		if(i*b ==n && isp(i) && isp(b)) {
    			cout<<b; return;
    		}
    	}
    } 
    int main(){
    	int t = 1;  // cin>>t;
    	while(t --){
    		solve();
    	}
    	return 0;
    }
    
    • 1

    信息

    ID
    98
    时间
    1000ms
    内存
    16MiB
    难度
    6
    标签
    递交数
    151
    已通过
    47
    上传者