QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#372329 | #8508. DiviDuelo | karuna | WA | 3ms | 3608kb | C++20 | 429b | 2024-03-31 11:29:04 | 2024-03-31 11:29:05 |
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; ll z = n;
for (ll d = 2; d * d <= n; d++) {
if (z % d == 0) ++x;
while (z % d == 0) {
z /= d;
++y;
}
}
if (z != 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: 3556kb
input:
10
output:
Y
result:
ok "Y"
Test #2:
score: 0
Accepted
time: 1ms
memory: 3604kb
input:
9
output:
N
result:
ok "N"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
1
output:
N
result:
ok "N"
Test #4:
score: -100
Wrong Answer
time: 3ms
memory: 3568kb
input:
549755813888
output:
N
result:
wrong answer 1st words differ - expected: 'Y', found: 'N'