結果

問題 No.1058 素敵な数
ユーザー qibqib
提出日時 2023-01-02 23:22:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 92 ms / 2,000 ms
コード長 377 bytes
コンパイル時間 600 ms
コンパイル使用メモリ 86,652 KB
実行使用メモリ 77,556 KB
最終ジャッジ日時 2023-08-17 23:57:05
合計ジャッジ時間 2,728 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
77,556 KB
testcase_01 AC 90 ms
76,968 KB
testcase_02 AC 90 ms
77,540 KB
testcase_03 AC 90 ms
77,184 KB
testcase_04 AC 87 ms
77,316 KB
testcase_05 AC 87 ms
77,256 KB
testcase_06 AC 88 ms
77,204 KB
testcase_07 AC 87 ms
77,308 KB
testcase_08 AC 88 ms
77,332 KB
testcase_09 AC 89 ms
77,256 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