結果

問題 No.1058 素敵な数
ユーザー brthyyjpbrthyyjp
提出日時 2020-05-24 05:24:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 600 bytes
コンパイル時間 533 ms
コンパイル使用メモリ 82,324 KB
実行使用メモリ 64,096 KB
最終ジャッジ日時 2024-04-18 08:54:29
合計ジャッジ時間 1,201 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
63,264 KB
testcase_01 AC 52 ms
63,888 KB
testcase_02 AC 48 ms
62,964 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

import math

def sieve(n):
    ass = []
    is_prime = [True]*(n+1)
    is_prime[0] = False
    is_prime[1] = False

    for i in range(2, int(math.sqrt(n))+1):
        if not is_prime[i]:
            continue
        for j in range(i*2, n+1, i):
            is_prime[j] = False
    for i in range(n+1):
        if is_prime[i]:
            ass.append(i)
    return(ass)

S = sieve(10**5)
T = sieve(2*10**5)
#print(len(S))
#print(len(T))
P = T[len(S):len(S)+10]
#print(P)
ans = [1]
for i in range(10):
    for j in range(10):
        ans.append(P[i]*P[j])
ans.sort()
print(ans[n-1])
0