結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー tamatotamato
提出日時 2021-07-21 21:45:06
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 670 bytes
コンパイル時間 1,113 ms
コンパイル使用メモリ 87,172 KB
実行使用メモリ 79,284 KB
最終ジャッジ日時 2023-09-24 16:28:20
合計ジャッジ時間 11,343 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 273 ms
77,940 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 251 ms
78,116 KB
testcase_14 AC 255 ms
78,332 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 233 ms
77,984 KB
testcase_19 AC 99 ms
77,104 KB
testcase_20 AC 102 ms
76,996 KB
testcase_21 AC 102 ms
77,052 KB
testcase_22 AC 99 ms
77,040 KB
testcase_23 AC 101 ms
77,108 KB
testcase_24 AC 102 ms
77,368 KB
testcase_25 AC 101 ms
77,152 KB
testcase_26 AC 103 ms
77,052 KB
testcase_27 AC 105 ms
77,456 KB
testcase_28 AC 73 ms
71,468 KB
testcase_29 AC 73 ms
71,416 KB
testcase_30 AC 73 ms
71,684 KB
testcase_31 AC 72 ms
71,660 KB
testcase_32 AC 71 ms
71,572 KB
testcase_33 AC 71 ms
71,452 KB
testcase_34 AC 70 ms
71,588 KB
testcase_35 AC 71 ms
71,416 KB
testcase_36 AC 72 ms
71,416 KB
testcase_37 AC 72 ms
71,732 KB
testcase_38 AC 71 ms
71,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    P = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]

    for _ in range(int(input())):
        X = int(input())
        mi = 10**12
        D = [0] * 12
        for i, p in enumerate(P):
            XX = X
            while XX % p == 0:
                D[i] += 1
                XX //= p
            mi = min(mi, p ** (D[i] + 1))
        for i in range(12):
            for j in range(i+1, 12):
                if (D[i] == 1 and D[j] == 2) or (D[i] == 2 and D[j] == 1):
                    mi = min(mi, P[i] * P[j])
        print(X * mi)


if __name__ == '__main__':
    main()
0