QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#372328 | #8508. DiviDuelo | karuna | TL | 1ms | 3656kb | C++20 | 426b | 2024-03-31 11:27:48 | 2024-03-31 11:27:49 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
cin.tie(0); ios_base::sync_with_stdio(0);
ll n;
cin >> n;
int x = 0, y = 0, z = n;
for (ll d = 2; d * d <= n; d++) {
if (z % d == 0) ++x;
while (z % d == 0) {
z /= d;
++y;
}
}
if (n != 1) ++x, ++y;
if ((x == 1 && y == 1) || (x == 2 && y == 2)) {
cout << "Y\n";
}
else {
cout << "N\n";
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3616kb
input:
10
output:
Y
result:
ok "Y"
Test #2:
score: 0
Accepted
time: 1ms
memory: 3568kb
input:
9
output:
N
result:
ok "N"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
1
output:
N
result:
ok "N"
Test #4:
score: -100
Time Limit Exceeded
input:
549755813888