a505. B. T-primes
標籤 :
通過比率 : 101人/132人 ( 77% ) [非即時]
評分方式:
Tolerant

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

內容

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.

輸入說明
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).
輸出說明
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.
範例輸入 #1
3
4 5 6
範例輸出 #1
YES
NO
NO
測資資訊:
記憶體限制: 512 MB
提示 :

 n,xi範圍與原題不同!

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

2012/10/11 加強測資! 

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

本題狀況 本題討論 排行

編號 身分 題目 主題 人氣 發表日期
17917 stu995106@ho ... (原來可以改暱稱) a505
1126 2019-06-02 14:21