結果

問題 No.1058 素敵な数
ユーザー toyuzukotoyuzuko
提出日時 2020-05-24 10:34:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 54 ms / 2,000 ms
コード長 445 bytes
コンパイル時間 135 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,648 KB
最終ジャッジ日時 2024-04-19 08:39:02
合計ジャッジ時間 1,215 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
11,392 KB
testcase_01 AC 54 ms
11,520 KB
testcase_02 AC 50 ms
11,392 KB
testcase_03 AC 50 ms
11,520 KB
testcase_04 AC 42 ms
11,392 KB
testcase_05 AC 49 ms
11,392 KB
testcase_06 AC 49 ms
11,520 KB
testcase_07 AC 45 ms
11,392 KB
testcase_08 AC 44 ms
11,520 KB
testcase_09 AC 45 ms
11,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def sieve(n):
    res = [True for _ in range(n + 1)]
    res[0] = False
    res[1] = False
    i = 2
    while i * i <= n:
        if res[i]:
            for j in range(i * 2, n + 1, i):
                res[j] = False
        i += 1
    return res

S = sieve(101000)
P = [p for p in range(101000) if S[p] and p > 100000]

Q = [1]

for i in range(10):
    for j in range(i, 10):
        Q.append(P[i] * P[j])

Q.sort()

print(Q[int(input()) - 1])
0