結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー titiatitia
提出日時 2021-08-13 21:02:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 747 ms / 2,000 ms
コード長 719 bytes
コンパイル時間 352 ms
コンパイル使用メモリ 82,652 KB
実行使用メモリ 77,896 KB
最終ジャッジ日時 2024-04-14 15:51:22
合計ジャッジ時間 12,955 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 747 ms
76,980 KB
testcase_01 AC 386 ms
77,532 KB
testcase_02 AC 388 ms
77,896 KB
testcase_03 AC 374 ms
77,620 KB
testcase_04 AC 372 ms
77,412 KB
testcase_05 AC 389 ms
77,472 KB
testcase_06 AC 389 ms
77,056 KB
testcase_07 AC 379 ms
77,312 KB
testcase_08 AC 380 ms
77,036 KB
testcase_09 AC 373 ms
77,184 KB
testcase_10 AC 326 ms
77,804 KB
testcase_11 AC 312 ms
76,980 KB
testcase_12 AC 323 ms
77,176 KB
testcase_13 AC 327 ms
77,396 KB
testcase_14 AC 335 ms
77,632 KB
testcase_15 AC 330 ms
77,520 KB
testcase_16 AC 314 ms
77,040 KB
testcase_17 AC 322 ms
77,112 KB
testcase_18 AC 324 ms
77,232 KB
testcase_19 AC 94 ms
77,160 KB
testcase_20 AC 81 ms
73,540 KB
testcase_21 AC 88 ms
77,296 KB
testcase_22 AC 95 ms
77,376 KB
testcase_23 AC 90 ms
77,164 KB
testcase_24 AC 89 ms
77,404 KB
testcase_25 AC 82 ms
74,148 KB
testcase_26 AC 90 ms
77,188 KB
testcase_27 AC 92 ms
77,380 KB
testcase_28 AC 52 ms
63,104 KB
testcase_29 AC 53 ms
64,348 KB
testcase_30 AC 52 ms
63,500 KB
testcase_31 AC 52 ms
63,684 KB
testcase_32 AC 52 ms
63,012 KB
testcase_33 AC 52 ms
64,284 KB
testcase_34 AC 52 ms
63,100 KB
testcase_35 AC 52 ms
63,440 KB
testcase_36 AC 52 ms
63,756 KB
testcase_37 AC 52 ms
63,076 KB
testcase_38 AC 53 ms
64,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

def fac(x):
    L=int(math.sqrt(x))

    FACT=dict()

    for i in range(2,L+2):
        while x%i==0:
            FACT[i]=FACT.get(i,0)+1
            x=x//i

    if x!=1:
        FACT[x]=FACT.get(x,0)+1

    return FACT

F=[[],[]]

for i in range(2,1000):
    F.append(fac(i))


T=int(input())
for tests in range(T):
    X=int(input())

    for i in range(2,1000):
        Y=X
        FA=F[i]

        bunbo=1
        bunsi=1

        for fa in FA:
            c=0
            while Y%fa==0:
                Y//=fa
                c+=1

            # c+FA[fa]+1/c+1
            bunbo*=c+1
            bunsi*=c+FA[fa]+1

        if bunbo*2==bunsi:
            print(X*i)
            break
                
0