QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#367776#8508. DiviDueloucup-team1196#WA 0ms3872kbC++20871b2024-03-26 13:42:352024-03-26 13:42:36

Judging History

This is the latest submission verdict.

  • [2024-03-26 13:42:36]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3872kb
  • [2024-03-26 13:42:35]
  • Submitted

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'