結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー FromBooskaFromBooska
提出日時 2024-03-18 14:14:54
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 1,400 bytes
コンパイル時間 369 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 91,136 KB
最終ジャッジ日時 2024-03-18 14:15:16
合計ジャッジ時間 7,828 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 859 ms
76,312 KB
testcase_02 AC 899 ms
76,212 KB
testcase_03 AC 901 ms
76,200 KB
testcase_04 AC 859 ms
76,840 KB
testcase_05 AC 887 ms
76,212 KB
testcase_06 AC 899 ms
76,208 KB
testcase_07 AC 893 ms
76,812 KB
testcase_08 AC 857 ms
76,336 KB
testcase_09 AC 898 ms
76,332 KB
testcase_10 AC 468 ms
76,360 KB
testcase_11 AC 511 ms
75,980 KB
testcase_12 AC 487 ms
76,232 KB
testcase_13 AC 551 ms
76,336 KB
testcase_14 AC 474 ms
76,244 KB
testcase_15 AC 475 ms
75,984 KB
testcase_16 AC 509 ms
76,232 KB
testcase_17 AC 474 ms
76,340 KB
testcase_18 AC 509 ms
76,212 KB
testcase_19 AC 87 ms
76,212 KB
testcase_20 AC 81 ms
74,324 KB
testcase_21 AC 87 ms
76,212 KB
testcase_22 AC 125 ms
76,344 KB
testcase_23 AC 78 ms
74,956 KB
testcase_24 AC 93 ms
76,384 KB
testcase_25 AC 78 ms
73,428 KB
testcase_26 AC 92 ms
76,244 KB
testcase_27 AC 82 ms
74,196 KB
testcase_28 AC 55 ms
53,460 KB
testcase_29 AC 47 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 39 ms
53,460 KB
testcase_34 AC 41 ms
53,460 KB
testcase_35 AC 38 ms
53,460 KB
testcase_36 AC 40 ms
53,460 KB
testcase_37 AC 37 ms
53,460 KB
testcase_38 AC 37 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
    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
    return count

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