QOJ.ac

QOJ

Time Limit: 1.0 s Memory Limit: 1024 MB Total points: 100 Hackable ✓

#249. 素性测试

Statistics

给定一个整数 $N$,你需要判断 $N$ 是否为质数。

输入包含多组测试数据。输入的第一行包含一个整数 $T$ ($1 \le T \le 10^5$),表示测试数据的组数。

对于每组测试数据,输入的第一行包含一个整数 $N$ ($1 \le N \le 10^{18}$)。

对于每组测试数据,如果 $N$ 是质数,输出一行 Yes。否则,输出一行 No

样例

输入格式 1

5
1
2
3
4
5

输出格式 1

No
Yes
Yes
No
Yes

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.