QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#372329#8508. DiviDuelokarunaWA 3ms3608kbC++20429b2024-03-31 11:29:042024-03-31 11:29:05

Judging History

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

  • [2024-03-31 11:29:05]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:3608kb
  • [2024-03-31 11:29:04]
  • 提交

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'