結果

問題 No.1058 素敵な数
ユーザー qibqib
提出日時 2023-01-02 23:22:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 377 bytes
コンパイル時間 966 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 62,208 KB
最終ジャッジ日時 2024-05-05 06:47:06
合計ジャッジ時間 1,302 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
61,696 KB
testcase_01 AC 51 ms
61,824 KB
testcase_02 AC 51 ms
62,208 KB
testcase_03 AC 51 ms
61,568 KB
testcase_04 AC 52 ms
61,184 KB
testcase_05 AC 52 ms
61,568 KB
testcase_06 AC 52 ms
62,208 KB
testcase_07 AC 54 ms
62,080 KB
testcase_08 AC 55 ms
61,952 KB
testcase_09 AC 51 ms
61,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools as it

n = int(input())

m = 100100
dp = [None for _ in range(m + 1)]
primes = []
for x in range(2, m + 1):
  if not dp[x] is None:
    continue
  dp[x] = True
  if x > 100000:
    primes.append(x)
  for y in range(2 * x, m + 1, x):
    dp[y] = False

q = [1]
for x, y in it.combinations_with_replacement(primes, 2):
  q.append(x * y)

q.sort()
print(q[n - 1])
0