QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#372328#8508. DiviDuelokarunaTL 1ms3656kbC++20426b2024-03-31 11:27:482024-03-31 11:27:49

Judging History

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

  • [2024-03-31 11:27:49]
  • 评测
  • 测评结果:TL
  • 用时:1ms
  • 内存:3656kb
  • [2024-03-31 11:27:48]
  • 提交

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, z = n;
	for (ll d = 2; d * d <= n; d++) {
		if (z % d == 0) ++x;
		while (z % d == 0) {
			z /= d;
			++y;
		}
	}
	if (n != 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: 3616kb

input:

10

output:

Y

result:

ok "Y"

Test #2:

score: 0
Accepted
time: 1ms
memory: 3568kb

input:

9

output:

N

result:

ok "N"

Test #3:

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

input:

1

output:

N

result:

ok "N"

Test #4:

score: -100
Time Limit Exceeded

input:

549755813888

output:


result: