結果

問題 No.1058 素敵な数
ユーザー prd_xxxprd_xxx
提出日時 2020-06-19 20:50:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 409 bytes
コンパイル時間 194 ms
コンパイル使用メモリ 10,836 KB
実行使用メモリ 8,148 KB
最終ジャッジ日時 2023-09-12 18:09:00
合計ジャッジ時間 1,026 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,148 KB
testcase_01 AC 15 ms
7,740 KB
testcase_02 AC 15 ms
7,704 KB
testcase_03 AC 15 ms
7,820 KB
testcase_04 AC 15 ms
7,700 KB
testcase_05 AC 15 ms
7,768 KB
testcase_06 AC 16 ms
7,704 KB
testcase_07 AC 15 ms
7,732 KB
testcase_08 AC 15 ms
7,904 KB
testcase_09 AC 15 ms
7,824 KB
権限があれば一括ダウンロードができます

ソースコード

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, 100100):
    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