結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー titiatitia
提出日時 2021-07-22 01:59:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 747 bytes
コンパイル時間 439 ms
コンパイル使用メモリ 10,828 KB
実行使用メモリ 16,336 KB
最終ジャッジ日時 2023-09-24 20:24:55
合計ジャッジ時間 22,705 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,649 ms
16,212 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 -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 81 ms
16,192 KB
testcase_29 AC 81 ms
16,188 KB
testcase_30 AC 84 ms
16,128 KB
testcase_31 AC 83 ms
16,244 KB
testcase_32 AC 83 ms
16,124 KB
testcase_33 AC 80 ms
16,296 KB
testcase_34 AC 79 ms
16,304 KB
testcase_35 WA -
testcase_36 AC 81 ms
16,128 KB
testcase_37 AC 81 ms
16,248 KB
testcase_38 AC 80 ms
16,276 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

x=2*10**5

import math 
L=math.floor(math.sqrt(x)) # 平方根を求める

Primelist=[i for i in range(x+1)]
Primelist[1]=0 # 1は素数でないので0にする.
 
for i in Primelist:
    if i>L:
        break
    if i==0:
        continue
    for j in range(2*i,x+1,i):
        Primelist[j]=0

Primes=[Primelist[j] for j in range(x+1) if Primelist[j]!=0]

T=int(input())
for tests in range(T):
    X=int(input())
    Y=X
    ANS=1<<30

    for p in Primes:
        if p>ANS:
            break
        
        if X%p!=0:
            ANS=min(ANS,p)
            break
        c=0
        while X%p==0:
            X//=p
            c+=1
        ANS=min(ANS,p**((c+1)*2-1-c))
        #print("!",p,c,ANS)

    print(ANS*Y)
        

        

    
0