結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー horitaka1999
提出日時 2021-07-23 00:47:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 795 bytes
コンパイル時間 139 ms
コンパイル使用メモリ 82,368 KB
実行使用メモリ 81,016 KB
最終ジャッジ日時 2024-07-17 22:03:38
合計ジャッジ時間 28,987 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 9 WA * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

primes = [2,3,5,7,11,13,17,19,23,29,31]
from collections import defaultdict
def f(x):
    tmp = x
    yaku1 = 1
    dic = defaultdict(int)
    coordinate = []
    for p in primes:
        cnt = 0
        while tmp % p == 0:
            tmp = tmp//p
            cnt += 1
        dic[p] = cnt
        yaku1 *= (cnt+1)
        coordinate.append(p**(cnt+1))
    for i in range(2,32):
        tmp = i
        yaku2 = 1
        for p in primes:
            cnt = 0
            while tmp % p == 0:
                tmp = tmp //p
                cnt += 1
            yaku2 *= (dic[p]+1)
        if 2 * yaku1 == yaku2:
            coordinate.append(i)


    return min(coordinate) * x 
T = int(input())
store = []
for _ in range(T):
    x = int(input())
    store.append(x)
for x in store:
    print(f(x))
0