結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 808 ms
78,948 KB
testcase_02 AC 788 ms
78,300 KB
testcase_03 AC 818 ms
79,032 KB
testcase_04 AC 825 ms
77,572 KB
testcase_05 AC 792 ms
78,308 KB
testcase_06 AC 823 ms
79,028 KB
testcase_07 AC 800 ms
78,152 KB
testcase_08 AC 790 ms
78,312 KB
testcase_09 AC 821 ms
78,336 KB
testcase_10 AC 479 ms
78,232 KB
testcase_11 AC 523 ms
78,224 KB
testcase_12 AC 486 ms
78,348 KB
testcase_13 AC 512 ms
78,456 KB
testcase_14 AC 496 ms
77,652 KB
testcase_15 AC 481 ms
78,308 KB
testcase_16 AC 511 ms
78,608 KB
testcase_17 AC 502 ms
78,648 KB
testcase_18 AC 552 ms
78,964 KB
testcase_19 AC 104 ms
76,028 KB
testcase_20 AC 108 ms
76,408 KB
testcase_21 AC 107 ms
76,404 KB
testcase_22 AC 107 ms
76,288 KB
testcase_23 AC 106 ms
76,316 KB
testcase_24 AC 104 ms
76,124 KB
testcase_25 AC 106 ms
76,276 KB
testcase_26 AC 108 ms
76,020 KB
testcase_27 AC 110 ms
76,392 KB
testcase_28 AC 73 ms
70,956 KB
testcase_29 AC 75 ms
71,124 KB
testcase_30 AC 74 ms
71,068 KB
testcase_31 AC 74 ms
71,068 KB
testcase_32 AC 74 ms
71,300 KB
testcase_33 AC 71 ms
71,132 KB
testcase_34 AC 72 ms
71,068 KB
testcase_35 AC 72 ms
70,796 KB
testcase_36 AC 72 ms
71,048 KB
testcase_37 AC 73 ms
71,128 KB
testcase_38 AC 74 ms
71,072 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

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
0