結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー FromBooskaFromBooska
提出日時 2024-03-18 14:24:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,573 ms / 2,000 ms
コード長 1,266 bytes
コンパイル時間 378 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 77,552 KB
最終ジャッジ日時 2024-03-18 14:24:23
合計ジャッジ時間 17,285 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,573 ms
77,552 KB
testcase_01 AC 646 ms
76,328 KB
testcase_02 AC 659 ms
76,256 KB
testcase_03 AC 647 ms
76,320 KB
testcase_04 AC 656 ms
76,252 KB
testcase_05 AC 633 ms
76,316 KB
testcase_06 AC 672 ms
76,204 KB
testcase_07 AC 640 ms
76,328 KB
testcase_08 AC 643 ms
76,188 KB
testcase_09 AC 639 ms
76,328 KB
testcase_10 AC 466 ms
76,220 KB
testcase_11 AC 464 ms
76,480 KB
testcase_12 AC 494 ms
76,220 KB
testcase_13 AC 472 ms
76,224 KB
testcase_14 AC 447 ms
76,356 KB
testcase_15 AC 449 ms
76,228 KB
testcase_16 AC 448 ms
76,228 KB
testcase_17 AC 466 ms
76,352 KB
testcase_18 AC 441 ms
76,352 KB
testcase_19 AC 83 ms
76,220 KB
testcase_20 AC 83 ms
76,220 KB
testcase_21 AC 83 ms
76,224 KB
testcase_22 AC 75 ms
74,440 KB
testcase_23 AC 77 ms
74,564 KB
testcase_24 AC 84 ms
76,352 KB
testcase_25 AC 92 ms
76,348 KB
testcase_26 AC 84 ms
76,220 KB
testcase_27 AC 78 ms
75,076 KB
testcase_28 AC 37 ms
53,460 KB
testcase_29 AC 36 ms
53,460 KB
testcase_30 AC 37 ms
53,460 KB
testcase_31 AC 37 ms
53,460 KB
testcase_32 AC 37 ms
53,460 KB
testcase_33 AC 36 ms
53,460 KB
testcase_34 AC 36 ms
53,460 KB
testcase_35 AC 36 ms
53,460 KB
testcase_36 AC 37 ms
53,460 KB
testcase_37 AC 39 ms
53,460 KB
testcase_38 AC 39 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 count, prod

T = int(input())
for t in range(T):
    X = int(input())
    original, original_count = count_low_primefactors(X)
    
    for k in range(2, 38):
        temp, temp_count = count_low_primefactors(k)
        new = 1
        for i in range(12):
            new *= (1+original[i]+temp[i])
        if new == original_count*2:
            print(X*k)
            break
0