結果

問題 No.1058 素敵な数
ユーザー brthyyjpbrthyyjp
提出日時 2020-05-24 05:21:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 561 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 82,400 KB
実行使用メモリ 65,300 KB
最終ジャッジ日時 2024-04-18 08:49:23
合計ジャッジ時間 1,222 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
64,340 KB
testcase_01 AC 51 ms
62,904 KB
testcase_02 AC 46 ms
63,412 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):
    ans.append(P[0]*P[i])
print(ans[n-1])
0