QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#361808#8508. DiviDueloucup-team1516#WA 1ms3780kbC++17942b2024-03-23 13:18:252024-03-23 13:18:26

Judging History

你现在查看的是最新测评结果

  • [2024-03-23 13:18:26]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3780kb
  • [2024-03-23 13:18:25]
  • 提交

answer

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
    return (ull)rng() % B;
}
inline double time() {
    return static_cast<long double>(chrono::duration_cast<chrono::nanoseconds>(chrono::steady_clock::now().time_since_epoch()).count()) * 1e-9;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll n; cin >> n;
    if (n == 1) {
        cout << "N" << endl;
        return 0;
    }
    vector<ll> p;
    for (ll i = 2; i*i <= n; ++i) {
        while (n%i == 0) {
            p.push_back(i);
            n /= i;
        }
    }
    if (n > 1) p.push_back(n);
    if (p.size() <= 1 or (p.size() == 2 and p[0] == p[1])) {
        cout << "N" << endl;
    }
    else {
        cout << "Y" << endl;
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3580kb

input:

10

output:

Y

result:

ok "Y"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3580kb

input:

9

output:

N

result:

ok "N"

Test #3:

score: 0
Accepted
time: 0ms
memory: 3576kb

input:

1

output:

N

result:

ok "N"

Test #4:

score: 0
Accepted
time: 0ms
memory: 3780kb

input:

549755813888

output:

Y

result:

ok "Y"

Test #5:

score: -100
Wrong Answer
time: 1ms
memory: 3544kb

input:

274877906944

output:

Y

result:

wrong answer 1st words differ - expected: 'N', found: 'Y'