結果

問題 No.1058 素敵な数
ユーザー GeckoちゃんGeckoちゃん
提出日時 2020-05-22 21:45:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 841 bytes
コンパイル時間 121 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-04-15 16:27:51
合計ジャッジ時間 1,063 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,880 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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])
0