結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー horitaka1999horitaka1999
提出日時 2021-07-23 00:44:59
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 796 bytes
コンパイル時間 472 ms
コンパイル使用メモリ 87,000 KB
実行使用メモリ 83,684 KB
最終ジャッジ日時 2023-09-24 21:38:13
合計ジャッジ時間 7,717 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 TLE -
testcase_02 TLE -
testcase_03 TLE -
testcase_04 TLE -
testcase_05 TLE -
testcase_06 TLE -
testcase_07 TLE -
testcase_08 TLE -
testcase_09 TLE -
testcase_10 AC 1,526 ms
83,684 KB
testcase_11 AC 1,716 ms
83,064 KB
testcase_12 AC 1,708 ms
83,220 KB
testcase_13 AC 1,502 ms
82,308 KB
testcase_14 AC 1,512 ms
83,028 KB
testcase_15 AC 1,517 ms
82,292 KB
testcase_16 AC 1,514 ms
82,412 KB
testcase_17 AC 1,505 ms
82,360 KB
testcase_18 AC 1,505 ms
82,096 KB
testcase_19 AC 161 ms
78,124 KB
testcase_20 AC 157 ms
78,344 KB
testcase_21 AC 158 ms
78,136 KB
testcase_22 AC 160 ms
78,240 KB
testcase_23 AC 160 ms
78,244 KB
testcase_24 AC 157 ms
78,124 KB
testcase_25 AC 220 ms
78,224 KB
testcase_26 AC 161 ms
78,236 KB
testcase_27 AC 157 ms
78,108 KB
testcase_28 AC 99 ms
76,780 KB
testcase_29 AC 99 ms
76,572 KB
testcase_30 AC 104 ms
77,188 KB
testcase_31 AC 104 ms
76,928 KB
testcase_32 AC 105 ms
77,344 KB
testcase_33 AC 104 ms
77,080 KB
testcase_34 AC 103 ms
76,464 KB
testcase_35 AC 102 ms
76,964 KB
testcase_36 AC 102 ms
77,076 KB
testcase_37 AC 101 ms
77,276 KB
testcase_38 AC 101 ms
77,028 KB
権限があれば一括ダウンロードができます

ソースコード

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 = x * i
        yaku2 = 1
        for p in primes:
            cnt = 0
            while tmp % p == 0:
                tmp = tmp //p
                cnt += 1
            yaku2 *= (cnt+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