結果

問題 No.1058 素敵な数
ユーザー NoaSaberNoaSaber
提出日時 2021-04-05 21:54:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 550 bytes
コンパイル時間 511 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 89,868 KB
最終ジャッジ日時 2023-08-30 08:51:06
合計ジャッジ時間 2,652 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
89,812 KB
testcase_01 AC 120 ms
89,740 KB
testcase_02 AC 126 ms
89,852 KB
testcase_03 AC 125 ms
89,796 KB
testcase_04 AC 124 ms
89,808 KB
testcase_05 AC 122 ms
89,864 KB
testcase_06 AC 123 ms
89,868 KB
testcase_07 AC 121 ms
89,812 KB
testcase_08 AC 120 ms
89,772 KB
testcase_09 AC 123 ms
89,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

l=[]
N=int(input())
def eratosthenes(n):
    if n==2:
        return [2]
    prime = [2]
    limit = int(n**0.5)
    data = [i + 1 for i in range(2, n, 2)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]
x=eratosthenes(150000)
ans=[1]
for i in x:
    if i>100000:
        l.append(i)
    if len(l)==10:
        break
for i in range(10):
    for j in range(10):
        ans.append(l[i]*l[j])
ans=list(set(ans))
ans.sort()
print(ans[N-1])
0