• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            GLORY | 學(xué)習(xí)·記錄

            coding for life

            POJ 3006 Dirichlet's Theorem on Arithmetic Progressions

            這兩天都是水題,沒有什么想法而言,就是為了熟悉一下感覺。我又給互聯(lián)網(wǎng)上增加了不少垃圾日志。
            昨晚出了點(diǎn)突發(fā)事件,原定的寫程序事件被用來處理事情了。不過后來我倒是有點(diǎn)想明白了,題目只是很少一點(diǎn)時間在看題目,很忙的時候可以先花幾分鐘把題目弄明白了,然后在去忙別的事情,這種件的空隙還能想一想思路。不知POJ有什么辦法可以把題目批量導(dǎo)出的,我就不用天天費(fèi)勁上網(wǎng)讀題目了,在單位也能抽空瞅兩眼。

            我堅(jiān)持兩件事情:1。決不直接貼
            題目代碼  2。每天都寫題目

            POJ 3006
            計(jì)劃打個表,然后直接搞,看了一下數(shù)據(jù)很小,應(yīng)該沒有什么問題。

            在這里順便題一下素數(shù)篩選法。
            以下內(nèi)容來自Wikipedia:

            To find all the prime numbers less than or equal to a given integer n by Eratosthenes' method:

            1. Create a list of consecutive integers from two to n: (2, 3, 4, ..., n).
            2. Initially, let p equal 2, the first prime number.
            3. Strike from the list all multiples of p less than or equal to n. (2p, 3p, 4p, etc.)
            4. Find the first number remaining on the list after p (this number is the next prime); replace p with this number.
            5. Repeat steps 3 and 4 until p2 is greater than n.
            6. All the remaining numbers in the list are prime
            后來,歐拉同學(xué)提出了另外一個辦法,讓每個數(shù)只要標(biāo)記一次就ok

            A) Start with all the natural numbers except '1' which is not a prime:

            2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ...
            ^

            B) The leftmost number is prime. Multiply each number in the list by this prime and
            then discard the products:

            (4 6 8 10 12 14 16 18 20 22 24 26 28 30 ... )

            These are removed:
            4 6 8 10 12 14 16 18 20 22 24 26 28 30

            These are left:
            2 3 5 7 9 11 13 15 17 19 21 23 25 27 29 ...
            ^

            C) The number after the previous prime is also a prime. Multiply by it each number
            in the new list starting from this prime and then discard the products:

            (9 15 21 27 33 39 45 51 57 63 69 75 81 87 ...)

            These are removed:
            9 15 21 27

            These are left:
            2 3 5 7 11 13 17 19 23 25 29 ...
            ^





            =================================================
            2010-7-13 23:47
            拆掉了自己的惠普V3159筆記本,心情一片大好,竟然裝上以后運(yùn)行正常了。出來混,遲早要還,之前一直對于拆機(jī)器的事情不感興趣,現(xiàn)在可真是被逼得。
            我終于可以去中關(guān)村賺取那90塊的拆機(jī)費(fèi)了: )
            PS:今天中午修好了屋子里面的抽水馬桶,心情一片大好。

            posted on 2010-07-12 13:07 meglory 閱讀(219) 評論(0)  編輯 收藏 引用 所屬分類: Algorithms

            導(dǎo)航

            隨筆分類

            隨筆檔案

            最新評論

            国产福利电影一区二区三区久久久久成人精品综合 | 日韩精品无码久久久久久| 久久久精品人妻无码专区不卡 | 超级碰碰碰碰97久久久久| 欧美黑人又粗又大久久久| 91精品婷婷国产综合久久| 欧美亚洲另类久久综合婷婷| 久久免费看黄a级毛片| 人妻无码αv中文字幕久久琪琪布 人妻无码久久一区二区三区免费 人妻无码中文久久久久专区 | 丰满少妇人妻久久久久久4| 久久国产精品99精品国产987| 欧美精品丝袜久久久中文字幕| 亚洲va久久久噜噜噜久久天堂| 国产福利电影一区二区三区久久久久成人精品综合 | 99久久精品午夜一区二区| 精品乱码久久久久久夜夜嗨| 亚洲天堂久久久| 精品国产青草久久久久福利| 久久男人Av资源网站无码软件 | 国产91久久综合| 97久久久精品综合88久久| 免费精品久久天干天干| 久久久综合香蕉尹人综合网| 国产精品久久久久久| 久久偷看各类wc女厕嘘嘘| 久久久久亚洲av综合波多野结衣 | 99久久精品国产麻豆| 亚洲午夜无码久久久久| 亚洲人成无码网站久久99热国产| 亚洲国产精品久久久久| 久久精品无码一区二区三区| 久久天天躁狠狠躁夜夜躁2O2O| 伊人久久无码精品中文字幕| 青青青青久久精品国产h久久精品五福影院1421 | 久久亚洲精品无码AV红樱桃| 精品久久久久一区二区三区| 青青青伊人色综合久久| 婷婷综合久久中文字幕| 久久久久国产一级毛片高清版| 久久精品国产AV一区二区三区| 欧美亚洲国产精品久久高清|