結果

問題 No.1058 素敵な数
ユーザー aaaaaaaaaa
提出日時 2020-05-22 23:43:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 166 ms / 2,000 ms
コード長 473 bytes
コンパイル時間 190 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 104,832 KB
最終ジャッジ日時 2024-04-15 19:19:07
合計ジャッジ時間 2,452 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 162 ms
104,576 KB
testcase_01 AC 166 ms
104,448 KB
testcase_02 AC 165 ms
104,448 KB
testcase_03 AC 163 ms
104,576 KB
testcase_04 AC 161 ms
104,832 KB
testcase_05 AC 161 ms
104,484 KB
testcase_06 AC 164 ms
104,440 KB
testcase_07 AC 164 ms
104,448 KB
testcase_08 AC 163 ms
104,724 KB
testcase_09 AC 164 ms
104,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def sieve_of_eratosthenes(n):
    pl = [i for i in range(2, n + 1)]
    i=0
    p = pl[0]
    while p**2<=n:
        pl = [pl[j] for j in range(len(pl)) if pl[j]%p!=0 or j<=i]
        i+=1
        p=pl[i]
    return pl

pl = sieve_of_eratosthenes(200000)

pl2 = []
for p in pl:
    if p>100000:
        pl2.append(p)

pl3 = pl2[:10]

pl4 = [1]

for p1 in pl3:
    for p2 in pl3:
        pl4.append(p1*p2)

pl4 = list(set(pl4))

pl4.sort()

N = int(input())

print(pl4[N-1])
0