c030. 判斷質數
Tags : 質數
Accepted rate : 3人/3人 ( 100% ) [非即時]
評分方式:
Tolerant

最近更新 : 2024-07-03 21:50

Content

給定一個非負整數 $n$ ,請判斷這個數是否為質數。

Input

一個整數 $n(n<=10^{15})$ 。

Output

如果 $n$ 是質數,請輸出"prime",否則輸出"not prime"。

Sample Input #1
2
Sample Output #1
prime
Sample Input #2
18
Sample Output #2
not prime
測資資訊:
記憶體限制: 64 MB
公開 測資點#0 (20%): 0.3s , <1K
公開 測資點#1 (20%): 0.3s , <1K
公開 測資點#2 (20%): 0.3s , <1K
公開 測資點#3 (20%): 0.3s , <1K
公開 測資點#4 (20%): 0.3s , <1K
Hint :
Tags:
質數
出處:
[管理者: jackhuang(fijjj) ]


ID User Problem Subject Hit Post Date
沒有發現任何「解題報告」