結果

問題 No.1058 素敵な数
ユーザー 👑 timitimi
提出日時 2020-10-07 22:12:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 18 ms / 2,000 ms
コード長 605 bytes
コンパイル時間 120 ms
コンパイル使用メモリ 10,860 KB
実行使用メモリ 8,220 KB
最終ジャッジ日時 2023-09-27 10:06:30
合計ジャッジ時間 1,187 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,220 KB
testcase_01 AC 17 ms
7,880 KB
testcase_02 AC 17 ms
7,752 KB
testcase_03 AC 17 ms
7,852 KB
testcase_04 AC 18 ms
7,764 KB
testcase_05 AC 17 ms
7,808 KB
testcase_06 AC 17 ms
7,920 KB
testcase_07 AC 17 ms
7,916 KB
testcase_08 AC 17 ms
7,820 KB
testcase_09 AC 17 ms
7,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
if N==1:
    print(1)
    exit()
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr
D=[]
d=10**5-1
for i in range(1,70):
    d+=2
    e=factorization(d)
    if len(e)==1:
        D.append(d)
ans=[]
for i in D:
    for j in D:
        ans.append(i*j)
E=list(set(ans))
E=sorted(E)
print(E[N-2])
0