a505: B. T-primes
Tags :
Accepted rate : 77人/96人 ( 80% ) [非即時]
評分方式:
Tolerant

最近更新 : 2012-10-11 22:44

Content

We know that prime numbers are positive integers that have exactly two distinct positive divisors. Similarly, we'll call a positive integer t Т-prime, if t has exactly three distinct positive divisors.
You are given an array of n positive integers. For each of them determine whether it is Т-prime or not.

Input
The first line contains a single positive integer, n (1 ≤ n ≤ 106), showing how many numbers are in the array. The next line contains nspace-separated integers xi (1 ≤ xi ≤ 1014).
Output
Print n lines: the i-th line should contain "YES" (without the quotes), if number xi is Т-prime, and "NO" (without the quotes), if it isn't.
Sample Input
3
4 5 6
Sample Output
YES
NO
NO
測資資訊:
記憶體限制: 512 MB
公開 測資點#0 (50%): 1.0s , <10M
公開 測資點#1 (50%): 1.0s , <50M
Hint :

 n,xi範圍與原題不同!

 測試資料較大!請使用較快的輸出入!

2012/10/11 加強測資! 

Tags:
出處:
CodeForce230BT-primes [管理者:
eddy841021 (C++?)
]


ID User Problem Subject Hit Post Date
17917
stu995106@hotma... (Cheng Benny)
a505
想法
105 2019-06-02 14:21