結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー MineMine
提出日時 2021-09-10 14:11:11
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 788 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 87,412 KB
実行使用メモリ 80,612 KB
最終ジャッジ日時 2023-09-01 03:01:05
合計ジャッジ時間 17,100 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 404 ms
79,576 KB
testcase_11 AC 458 ms
80,144 KB
testcase_12 AC 418 ms
79,536 KB
testcase_13 AC 421 ms
79,456 KB
testcase_14 AC 452 ms
79,844 KB
testcase_15 AC 427 ms
79,648 KB
testcase_16 AC 424 ms
79,556 KB
testcase_17 AC 407 ms
79,456 KB
testcase_18 AC 448 ms
80,612 KB
testcase_19 AC 168 ms
79,724 KB
testcase_20 AC 155 ms
80,368 KB
testcase_21 AC 142 ms
79,144 KB
testcase_22 AC 131 ms
78,640 KB
testcase_23 AC 138 ms
79,192 KB
testcase_24 AC 155 ms
80,416 KB
testcase_25 AC 158 ms
80,304 KB
testcase_26 AC 149 ms
79,820 KB
testcase_27 AC 140 ms
79,216 KB
testcase_28 AC 87 ms
72,256 KB
testcase_29 AC 85 ms
71,824 KB
testcase_30 AC 86 ms
72,260 KB
testcase_31 AC 85 ms
72,020 KB
testcase_32 AC 86 ms
72,040 KB
testcase_33 AC 85 ms
72,212 KB
testcase_34 AC 85 ms
72,204 KB
testcase_35 AC 84 ms
72,180 KB
testcase_36 AC 86 ms
72,156 KB
testcase_37 AC 86 ms
71,824 KB
testcase_38 AC 85 ms
72,276 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, 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