QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#367776 | #8508. DiviDuelo | ucup-team1196# | WA | 0ms | 3872kb | C++20 | 871b | 2024-03-26 13:42:35 | 2024-03-26 13:42:36 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
std::cin >> n;
std::vector<int> q;
int x = n;
for (int i = 2; i * i <= n; i++) {
if (x % i == 0) {
int cnt = 0;
while (x % i == 0) {
x /= i;
}
q.push_back(cnt);
}
}
if (x != 1) q.push_back(1);
int even = 1;
for (auto x : q) {
if (x % 2 != 0) even = 0;
}
if (even) {
std::cout << "N\n";
} else {
if (q.size() == 1) {
std::cout << "Y\n";
} else if (q.size() == 2 && q[0] == 1 && q[1] == 1) {
std::cout << "Y\n";
} else {
std::cout << "N\n";
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3872kb
input:
10
output:
N
result:
wrong answer 1st words differ - expected: 'Y', found: 'N'