結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー FromBooskaFromBooska
提出日時 2023-08-13 18:49:06
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 1,192 bytes
コンパイル時間 556 ms
コンパイル使用メモリ 86,764 KB
実行使用メモリ 79,520 KB
最終ジャッジ日時 2023-08-13 18:50:26
合計ジャッジ時間 21,611 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 789 ms
78,848 KB
testcase_02 AC 783 ms
77,984 KB
testcase_03 AC 785 ms
77,696 KB
testcase_04 AC 816 ms
77,208 KB
testcase_05 AC 784 ms
78,324 KB
testcase_06 AC 788 ms
77,420 KB
testcase_07 AC 789 ms
78,356 KB
testcase_08 AC 784 ms
77,236 KB
testcase_09 AC 785 ms
78,188 KB
testcase_10 AC 484 ms
78,268 KB
testcase_11 AC 489 ms
78,488 KB
testcase_12 AC 477 ms
78,080 KB
testcase_13 AC 501 ms
78,784 KB
testcase_14 AC 485 ms
77,532 KB
testcase_15 AC 485 ms
78,288 KB
testcase_16 AC 490 ms
77,888 KB
testcase_17 AC 518 ms
78,232 KB
testcase_18 AC 510 ms
78,300 KB
testcase_19 AC 105 ms
76,460 KB
testcase_20 AC 106 ms
76,376 KB
testcase_21 AC 105 ms
76,232 KB
testcase_22 AC 106 ms
75,772 KB
testcase_23 AC 106 ms
76,452 KB
testcase_24 AC 106 ms
76,340 KB
testcase_25 AC 108 ms
76,256 KB
testcase_26 AC 105 ms
76,224 KB
testcase_27 AC 107 ms
75,780 KB
testcase_28 AC 71 ms
71,276 KB
testcase_29 AC 73 ms
71,256 KB
testcase_30 AC 76 ms
71,100 KB
testcase_31 AC 75 ms
71,284 KB
testcase_32 AC 73 ms
70,848 KB
testcase_33 AC 75 ms
71,012 KB
testcase_34 AC 73 ms
71,148 KB
testcase_35 AC 73 ms
71,208 KB
testcase_36 AC 73 ms
71,276 KB
testcase_37 AC 74 ms
71,124 KB
testcase_38 AC 74 ms
71,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# Xを素因数分解
# 既存素因数のべき乗を倍にするか、ない素因数を加える
# 10**11ということは37までに存在しない素因数があるはず
# 2*3*5*7*11*13*17*19*23*29*31*37 = 7*10**12
# 必要なのは37までの素因数だけ
# WAだった、2の乗数と3の乗数が両方増えるというパターンがある
# 素因数で考えると、そのコンビネーションもあるから難しい
# 発想の転換、multiplierは37までのどれかの数字にあると考えればいい
# 37超の素因数は無視する

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

def low_prime_div_count(num):
    div_count = 1
    for p in primes:
        c = 0
        while num%p == 0:
            num //= p
            c += 1
        div_count *= (c+1)
    return div_count

def main():
    T = int(input())
    for t in range(T):
        X = int(input())
        base = low_prime_div_count(X)
        #print('base', base)
        for n in range(2, 38):
            temp = low_prime_div_count(X*n)
            #print('n', n, 'temp', temp)
            if temp == base*2:
                print(X*n)
                break
                
main()
0