結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー FromBooskaFromBooska
提出日時 2023-08-13 18:31:32
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 1,112 bytes
コンパイル時間 216 ms
コンパイル使用メモリ 82,436 KB
実行使用メモリ 77,904 KB
最終ジャッジ日時 2024-05-01 11:09:32
合計ジャッジ時間 20,690 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 761 ms
76,836 KB
testcase_02 AC 744 ms
76,328 KB
testcase_03 AC 743 ms
76,744 KB
testcase_04 AC 784 ms
76,472 KB
testcase_05 AC 739 ms
76,560 KB
testcase_06 AC 757 ms
76,936 KB
testcase_07 AC 771 ms
76,724 KB
testcase_08 AC 745 ms
76,576 KB
testcase_09 AC 742 ms
76,800 KB
testcase_10 AC 439 ms
77,352 KB
testcase_11 AC 458 ms
77,368 KB
testcase_12 AC 445 ms
77,436 KB
testcase_13 AC 456 ms
77,788 KB
testcase_14 AC 461 ms
76,884 KB
testcase_15 AC 456 ms
77,904 KB
testcase_16 AC 443 ms
77,660 KB
testcase_17 AC 468 ms
77,284 KB
testcase_18 AC 479 ms
77,440 KB
testcase_19 AC 70 ms
70,548 KB
testcase_20 AC 73 ms
71,572 KB
testcase_21 AC 71 ms
71,084 KB
testcase_22 AC 69 ms
70,424 KB
testcase_23 AC 71 ms
72,164 KB
testcase_24 AC 73 ms
71,148 KB
testcase_25 AC 76 ms
72,144 KB
testcase_26 AC 73 ms
70,876 KB
testcase_27 AC 72 ms
72,388 KB
testcase_28 AC 35 ms
52,988 KB
testcase_29 AC 36 ms
52,548 KB
testcase_30 AC 36 ms
53,352 KB
testcase_31 AC 36 ms
52,272 KB
testcase_32 AC 36 ms
53,072 KB
testcase_33 AC 37 ms
52,336 KB
testcase_34 AC 37 ms
52,460 KB
testcase_35 AC 36 ms
53,268 KB
testcase_36 AC 36 ms
53,008 KB
testcase_37 AC 37 ms
52,240 KB
testcase_38 AC 37 ms
53,004 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