QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#380443 | #8508. DiviDuelo | johnsovero | WA | 0ms | 3760kb | C++14 | 819b | 2024-04-07 04:02:46 | 2024-04-07 04:02:48 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
using namespace::std;
bool countDivisors(int n)
{
vector<pair<int, int>> factors;
for (int i = 2; i * i <= n; i++) {
int count = 0;
while (n % i == 0) {
n /= i;
count++;
}
if (count > 0) factors.push_back({i, count});
}
if (n > 1) factors.push_back({n, 1});
for(pair<int,int> e: factors) cout << e.first << " " << e.second << '\n';
if(factors.size() == 1 && factors[0].second % 2 == 1) return true;
else {
for(pair<int, int> e: factors) {
if(e.second > 1) return false;
}
}
return true;
}
int32_t main() {
int N; cin >> N;
if (N != 1 && countDivisors(N)) cout << "Y\n";
else cout << "N\n";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3760kb
input:
10
output:
2 1 5 1 Y
result:
wrong answer 1st words differ - expected: 'Y', found: '2'