結果

問題 No.1058 素敵な数
コンテスト
ユーザー qib
提出日時 2023-01-02 23:22:32
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 33 ms / 2,000 ms
+ 319µs
コード長 377 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 74 ms
コンパイル使用メモリ 80,804 KB
実行使用メモリ 65,156 KB
最終ジャッジ日時 2026-09-30 14:29:51
合計ジャッジ時間 2,221 ms
ジャッジサーバーID
(参考情報)
judge4_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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