結果

問題 No.1058 素敵な数
ユーザー SalmonizeSalmonize
提出日時 2020-06-08 19:14:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 515 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 10,788 KB
実行使用メモリ 8,968 KB
最終ジャッジ日時 2023-08-26 23:52:31
合計ジャッジ時間 1,234 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import sys

readline = sys.stdin.readline

ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))

def solve():
    n = ni()
    m = 10**5 + 10
    s = [1]*m
    for i in range(3, m, 2):
        if s[i]:
            for j in range(i*i, m, i):
                s[j] = 0
    g = [i for i in range(100001, m, 2) if s[i]]
    f = sorted(set([x*y for x in g for y in g] + [1]))
    print(f[n-1])
    return

solve()
0