結果

問題 No.1058 素敵な数
ユーザー prd_xxxprd_xxx
提出日時 2020-06-19 20:50:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 410 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 10,908 KB
実行使用メモリ 15,324 KB
最終ジャッジ日時 2023-09-12 18:11:34
合計ジャッジ時間 3,588 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

N = int(input())
if N==1:
    print(1)
    exit()

def is_prime(n):
    if n == 2: return True
    if n < 2 or n%2 == 0: return False
    m = 3
    while m*m <= n:
        if n%m == 0: return False
        m += 2
    return True

arr = []
for n in range(100001, 1001000):
    if is_prime(n):
        arr.append(n)
arr2 = []
for a in arr:
    for b in arr:
        arr2.append(a*b)
print(sorted(set(arr2))[N-2])
0