質數惡夢


Submit solution

Points: 100 (partial)
Time limit: 1.0s
Python 3 10.0s
Memory limit: 1G

Author:
Problem type

串串做惡夢惹,他想數質數以快點清醒。「 \( 2 \) 、 \( 3 \) 、 \( 5 \) 、 \( 7 \) 、 \( 11 \) 、全家、來爾富、 OK…」,咦,好像有點怪怪的怪怪的。 請你幫幫串串,數出夠多質數逃離惡魔貓男。

輸入格式

輸入一正整數 M ( \( 2 \leq M \leq 94879469 \) ) 作為範圍頂端。

輸出格式

輸出小於 M 之所有質數並中間以空格分開。

範例輸入

20

範例輸出

2 3 5 7 11 13 17 19

提示

AC 後可以試試看 b032,不過其實兩題沒有關係。

Comments


  • 0
    dc  commented on Nov. 7, 2024, 2:32 p.m.

    Test case #10 要 Test case #9 五倍的時間。


  • 1
    dc  commented on Oct. 31, 2024, 9:35 a.m.

    這題怎會 OLE 想不通。


    • 0
      電研網管打工人  commented on Oct. 31, 2024, 12:47 p.m.

      感謝回報 我研究一下 題目是腳本直接遷移過來的請見諒


      • 1
        dc  commented on Oct. 31, 2024, 12:49 p.m.

        3Q