結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 420 ms
89,852 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 103 ms
88,848 KB
testcase_29 AC 103 ms
88,848 KB
testcase_30 AC 101 ms
89,056 KB
testcase_31 AC 101 ms
89,132 KB
testcase_32 AC 103 ms
89,052 KB
testcase_33 AC 103 ms
88,940 KB
testcase_34 AC 103 ms
88,736 KB
testcase_35 WA -
testcase_36 AC 103 ms
88,572 KB
testcase_37 AC 101 ms
89,164 KB
testcase_38 AC 101 ms
89,188 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
    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 ans < P:
        print(ans * u)
    else:
        print(u * P)
0