結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー MineMine
提出日時 2021-09-10 14:22:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 681 ms / 2,000 ms
コード長 792 bytes
コンパイル時間 314 ms
コンパイル使用メモリ 87,156 KB
実行使用メモリ 80,372 KB
最終ジャッジ日時 2023-09-01 03:39:53
合計ジャッジ時間 16,843 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 681 ms
78,708 KB
testcase_01 AC 513 ms
80,052 KB
testcase_02 AC 539 ms
79,212 KB
testcase_03 AC 507 ms
79,916 KB
testcase_04 AC 523 ms
79,104 KB
testcase_05 AC 518 ms
78,904 KB
testcase_06 AC 514 ms
79,780 KB
testcase_07 AC 527 ms
79,580 KB
testcase_08 AC 537 ms
79,520 KB
testcase_09 AC 519 ms
79,716 KB
testcase_10 AC 449 ms
79,780 KB
testcase_11 AC 452 ms
78,904 KB
testcase_12 AC 480 ms
79,988 KB
testcase_13 AC 498 ms
80,052 KB
testcase_14 AC 501 ms
80,372 KB
testcase_15 AC 451 ms
79,652 KB
testcase_16 AC 451 ms
79,144 KB
testcase_17 AC 476 ms
80,096 KB
testcase_18 AC 476 ms
79,800 KB
testcase_19 AC 152 ms
79,252 KB
testcase_20 AC 142 ms
78,860 KB
testcase_21 AC 154 ms
79,068 KB
testcase_22 AC 142 ms
78,568 KB
testcase_23 AC 159 ms
79,020 KB
testcase_24 AC 149 ms
79,144 KB
testcase_25 AC 149 ms
78,616 KB
testcase_26 AC 151 ms
78,548 KB
testcase_27 AC 156 ms
79,192 KB
testcase_28 AC 93 ms
72,312 KB
testcase_29 AC 96 ms
72,032 KB
testcase_30 AC 96 ms
72,244 KB
testcase_31 AC 101 ms
72,036 KB
testcase_32 AC 110 ms
72,232 KB
testcase_33 AC 96 ms
72,136 KB
testcase_34 AC 102 ms
72,104 KB
testcase_35 AC 102 ms
72,212 KB
testcase_36 AC 107 ms
71,788 KB
testcase_37 AC 99 ms
72,232 KB
testcase_38 AC 101 ms
72,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict


def prime_factorization(n):
    arr = defaultdict(int)
    for i in range(2, int(n**0.5)+1):
        while n % i == 0:
            arr[i] += 1
            n //= i
    if n != 1:
        arr[n] += 1
    return arr


t = int(input())
ans = []
primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31]
options = [prime_factorization(i) for i in range(0, 32)]

for i in range(t):
    x = int(input())
    d = defaultdict(int)
    for p in primes:
        temp = x
        while temp % p == 0:
            d[p] += 1
            temp //= p
    for i in range(2, 32):
        xnum = 1
        opnum = 1
        for p in options[i]:
            xnum *= (d[p]+1)
            opnum *= (d[p] + options[i][p] + 1)
        if 2*xnum == opnum:
            break
    print(i*x)
0