10539: almost prime numbers
DESCRIPTION
10539: Almost Prime Numbers. ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 10539: Almost Prime Numbers 解題者: 侯沛彣 、 陳冠男 解題日期: 2006年 5 月 24 日 題意: APN. (almost prime number) 是指非質數但只能被某一個質數除盡 ( 也就是說 APN. = 某質數的 k 次方, k 為大於 1 的正整數 ) 。 - PowerPoint PPT PresentationTRANSCRIPT
- 10539: Almost Prime Numbers Problem Set Archive with Online Judge10539: Almost Prime Numbers 2006524APN. (almost prime number) (APN. = kk1)N (low, high) ( 0 < low
- Sample Input3
-
1
-
()tab[i]i2i3i41012APN.tab_App[]80,070qsorthigh < 106lowhightab[i]1tab_Aplowindex_lowhighindex_highhighAPN. = index_high - index_low + 1 = index_high - index_low
1
-
lowhighn(n1/2)2= O(n)n1/2table= O(n1/2)10121 Tera1012prime tabletab[i]code40Kbytesprime tableAPN. tablehard codetime limit: 1 secondsort APN. table10 secondesCqsortintdouble array
1