結果
| 問題 |
No.1058 素敵な数
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-22 21:45:17 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 841 bytes |
| コンパイル時間 | 131 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-10-05 16:35:48 |
| 合計ジャッジ時間 | 1,124 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 9 |
ソースコード
from math import sqrt
from collections import Counter
def prime_factorization(n):
counter = Counter()
for i in range(2, int(sqrt(n)) + 1):
while n % i == 0:
n //= i
counter[i] += 1
if n != 1:
counter[n] += 1
return list(counter.items())
def prime_factors(n):
return set(map(lambda x: x[0], prime_factorization(n)))
"""
non = set()
for to_f in range(2, 10**5+1):
print(to_f, prime_factors(to_f))
non |= prime_factors(to_f)
ans = []
cur = 10**5+1
while True:
now = prime_factors(cur)
if len(now & non) == 0:
ans.append(cur)
cur += 1
if len(ans) == 10:
break
print("***")
for a in ans:
print(a)
"""
res = """1
100003
100019
100043
100049
100057
100069
100103
100109
100129
100151""".split("\n")
i = int(input())
print(res[i-1])