結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー FromBooskaFromBooska
提出日時 2024-03-18 14:19:47
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 1,167 bytes
コンパイル時間 418 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 77,640 KB
最終ジャッジ日時 2024-03-18 14:20:08
合計ジャッジ時間 20,430 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 798 ms
76,320 KB
testcase_02 AC 771 ms
76,152 KB
testcase_03 AC 768 ms
76,320 KB
testcase_04 AC 787 ms
76,148 KB
testcase_05 AC 772 ms
76,152 KB
testcase_06 AC 799 ms
76,448 KB
testcase_07 AC 778 ms
76,152 KB
testcase_08 AC 765 ms
76,148 KB
testcase_09 AC 792 ms
76,156 KB
testcase_10 AC 457 ms
77,272 KB
testcase_11 AC 495 ms
77,376 KB
testcase_12 AC 454 ms
76,760 KB
testcase_13 AC 515 ms
76,736 KB
testcase_14 AC 476 ms
77,016 KB
testcase_15 AC 460 ms
77,260 KB
testcase_16 AC 474 ms
77,004 KB
testcase_17 AC 461 ms
77,272 KB
testcase_18 AC 476 ms
77,376 KB
testcase_19 AC 72 ms
70,572 KB
testcase_20 AC 72 ms
70,576 KB
testcase_21 AC 74 ms
72,648 KB
testcase_22 AC 72 ms
70,576 KB
testcase_23 AC 73 ms
70,572 KB
testcase_24 AC 75 ms
72,664 KB
testcase_25 AC 74 ms
72,664 KB
testcase_26 AC 77 ms
72,648 KB
testcase_27 AC 72 ms
70,576 KB
testcase_28 AC 35 ms
53,460 KB
testcase_29 AC 36 ms
53,460 KB
testcase_30 AC 35 ms
53,460 KB
testcase_31 AC 35 ms
53,460 KB
testcase_32 AC 34 ms
53,460 KB
testcase_33 AC 38 ms
53,460 KB
testcase_34 AC 36 ms
53,460 KB
testcase_35 AC 38 ms
53,460 KB
testcase_36 AC 37 ms
53,460 KB
testcase_37 AC 39 ms
53,460 KB
testcase_38 AC 36 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 素因数分解し、使っていない素因数を加えるか、または、2**2などを加える、どれが一番小さいか
# TLEした、素因数分解はやめてその素数が何個あるかだけ調べよう
# WAした、加える素因数は複数ということがありうる、たとえば2*3=6
# どの素因数をいくつ加えるかではコンビネーションが難しくなる、37までをかけて約数の個数が2倍になるものを探す、ただしフルの素因数分解はしない

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

def count_low_primefactors(num):
    #count = [0]*12
    prod = 1
    for i in range(12):
        p = primes[i]
        c = 0
        while True:
            if num%p == 0:
                c += 1
                num //= p
            else:
                break
        #count[i] = c
        prod *= (c+1)
    return prod

T = int(input())
for t in range(T):
    X = int(input())
    original_count = count_low_primefactors(X)
    
    for k in range(2, 38):
        temp_count = count_low_primefactors(X*k)
        if temp_count == original_count*2:
            print(X*k)
            break
0