結果
| 問題 |
No.1058 素敵な数
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-01-02 23:22:32 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 49 ms / 2,000 ms |
| コード長 | 377 bytes |
| コンパイル時間 | 302 ms |
| コンパイル使用メモリ | 82,228 KB |
| 実行使用メモリ | 62,720 KB |
| 最終ジャッジ日時 | 2024-11-27 01:26:56 |
| 合計ジャッジ時間 | 1,317 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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])