結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー 👑 rin204rin204
提出日時 2022-01-26 16:52:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,098 ms / 2,000 ms
コード長 735 bytes
コンパイル時間 1,233 ms
コンパイル使用メモリ 86,952 KB
実行使用メモリ 78,436 KB
最終ジャッジ日時 2023-08-24 22:07:30
合計ジャッジ時間 17,684 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,098 ms
77,592 KB
testcase_01 AC 556 ms
77,568 KB
testcase_02 AC 556 ms
77,720 KB
testcase_03 AC 553 ms
77,432 KB
testcase_04 AC 545 ms
77,424 KB
testcase_05 AC 550 ms
77,488 KB
testcase_06 AC 551 ms
77,756 KB
testcase_07 AC 577 ms
77,628 KB
testcase_08 AC 576 ms
77,800 KB
testcase_09 AC 564 ms
77,664 KB
testcase_10 AC 424 ms
78,384 KB
testcase_11 AC 436 ms
77,992 KB
testcase_12 AC 428 ms
78,232 KB
testcase_13 AC 426 ms
78,404 KB
testcase_14 AC 441 ms
78,176 KB
testcase_15 AC 425 ms
78,188 KB
testcase_16 AC 429 ms
78,436 KB
testcase_17 AC 432 ms
77,908 KB
testcase_18 AC 432 ms
77,772 KB
testcase_19 AC 113 ms
76,408 KB
testcase_20 AC 108 ms
76,056 KB
testcase_21 AC 116 ms
77,124 KB
testcase_22 AC 112 ms
76,628 KB
testcase_23 AC 109 ms
76,468 KB
testcase_24 AC 109 ms
76,352 KB
testcase_25 AC 109 ms
76,324 KB
testcase_26 AC 109 ms
76,392 KB
testcase_27 AC 111 ms
76,324 KB
testcase_28 AC 73 ms
71,212 KB
testcase_29 AC 74 ms
71,076 KB
testcase_30 AC 72 ms
71,344 KB
testcase_31 AC 75 ms
71,276 KB
testcase_32 AC 74 ms
71,120 KB
testcase_33 AC 79 ms
71,068 KB
testcase_34 AC 77 ms
71,264 KB
testcase_35 AC 80 ms
71,284 KB
testcase_36 AC 77 ms
71,268 KB
testcase_37 AC 73 ms
71,084 KB
testcase_38 AC 74 ms
71,320 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

prime = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31]
def solve():
    x = int(input())
    C = [0] * 32
    X = x
    for p in prime:
        cnt = 0
        while X % p == 0:
            X //= p
            cnt += 1
        C[p] = cnt
    for i in range(2, 32):
        if x % i != 0:
            print(x * i)
            return
        a = 1
        b = 1
        X = x
        I = i
        for p in prime:
            if I % p == 0:
                cnt = C[p]
                b *= cnt + 1
                while I % p == 0:
                    I //= p
                    cnt += 1
                a *= cnt + 1
        if a == 2 * b:
            print(x * i)
            return
            
    
for _ in range(int(input())):
    solve()
0