Created
November 7, 2018 17:55
-
-
Save tarik02/30e76e70d0097d1bceb80e4a37b48b48 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
using ull = unsigned long long; | |
ifstream in("input.txt"); | |
ofstream out("output.txt"); | |
int main() { | |
ull n; | |
in >> n; | |
if (n == 4) { | |
out << "NO" << endl; | |
return 0; | |
} | |
ull k = n; | |
for (ull i = 2; i * i <= n; ++i) { | |
if (n % i == 0) { | |
ull b = n / i; | |
if (k % i == 0) { | |
k /= i; | |
} | |
if (k % b == 0) { | |
k /= b; | |
} | |
} | |
} | |
out << ((k == 1) ? "YES" : "NO") << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment