結果
| 問題 | No.1058 素敵な数 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-01-02 23:22:32 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 46 ms / 2,000 ms |
| コード長 | 377 bytes |
| 記録 | |
| コンパイル時間 | 522 ms |
| コンパイル使用メモリ | 85,460 KB |
| 実行使用メモリ | 62,720 KB |
| 最終ジャッジ日時 | 2026-05-21 08:24:51 |
| 合計ジャッジ時間 | 1,567 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 |
ソースコード
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])