3 条题解

  • 0
    @ 2025-2-10 13:06:17
    // https://dashoj.com/p/98
    #include <bits/stdc++.h>
    
    using namespace std;
    typedef long long ll;
    
    ll n, ans = -1;
    
    int main() {
    	cin >> n;
    	for (ll i = 2; i * i <= n; i++) if (n % i == 0) ans = max(ans, max(i, n / i));
    	if (ans == -1) cout << "YES" << endl;
    	else cout << ans << endl;
    	return 0;
    }
    

    信息

    ID
    98
    时间
    1000ms
    内存
    256MiB
    难度
    6
    标签
    递交数
    199
    已通过
    64
    上传者