結果
| 問題 |
No.1058 素敵な数
|
| コンテスト | |
| ユーザー |
TakoKurage
|
| 提出日時 | 2020-05-23 04:23:31 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 433 bytes |
| コンパイル時間 | 183 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 21,504 KB |
| 最終ジャッジ日時 | 2024-10-06 12:29:18 |
| 合計ジャッジ時間 | 3,305 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 9 |
ソースコード
def primes(n):
memo = [True] * (n + 1)
i = 2
while i * i <= n:
if memo[i]:
j = i << 1
while j <= n:
memo[j] = False
j += i
i += 1
return [i for i in range(n + 1) if memo[i] and i >= 10 ** 5 + 1]
from itertools import combinations
N = int(input())
P = primes(10 ** 6)[:N]
A = [1] + sorted(x * y for x, y in combinations(P, 2))
print(A[N - 1])
TakoKurage