結果

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

テストケース

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

ソースコード

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**2
    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