結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー ああいいああいい
提出日時 2022-03-05 18:42:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 820 bytes
コンパイル時間 774 ms
コンパイル使用メモリ 87,192 KB
実行使用メモリ 90,400 KB
最終ジャッジ日時 2023-09-27 06:37:25
合計ジャッジ時間 15,509 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 429 ms
90,400 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 AC 462 ms
90,296 KB
testcase_14 AC 448 ms
89,548 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 453 ms
89,812 KB
testcase_19 AC 143 ms
89,884 KB
testcase_20 AC 142 ms
89,816 KB
testcase_21 AC 150 ms
90,140 KB
testcase_22 AC 140 ms
89,408 KB
testcase_23 AC 139 ms
89,184 KB
testcase_24 AC 137 ms
89,304 KB
testcase_25 AC 148 ms
89,680 KB
testcase_26 AC 141 ms
89,512 KB
testcase_27 AC 146 ms
90,120 KB
testcase_28 AC 118 ms
89,064 KB
testcase_29 AC 112 ms
89,004 KB
testcase_30 AC 116 ms
88,868 KB
testcase_31 AC 112 ms
88,680 KB
testcase_32 AC 114 ms
89,012 KB
testcase_33 AC 115 ms
88,720 KB
testcase_34 AC 115 ms
88,984 KB
testcase_35 AC 116 ms
88,996 KB
testcase_36 AC 116 ms
88,952 KB
testcase_37 AC 115 ms
89,128 KB
testcase_38 AC 117 ms
88,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())

C = 10 ** 6
dat = [0] * C
prime = []
for i in range(2,C):
    if dat[i] == 0:
        prime.append(i)
        for j in range(2 * i,C,i):
            dat[j] = 1
for _ in range(T):
    X = int(input())
    u = X
    P = -1
    ans = 1 << 30
    a = None
    b = None
    for p in prime:
        if X % p != 0:
            P = p
            break
        else:
            count = 0
            while X % p == 0:
                count += 1
                X //= p
            if pow(p,count + 1) < ans:
                ans = p ** (count+1)
            if count == 1 and a is None:
                a = p
            if count == 2 and b is None:
                b = p
    if P < ans:
        ans = P
    if a is not None and b is not None:
        if a * b < ans:
            ans = a * b
    print(ans * u)
0