結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー horitaka1999horitaka1999
提出日時 2021-07-23 00:48:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,430 ms / 2,000 ms
コード長 799 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 82,428 KB
実行使用メモリ 80,992 KB
最終ジャッジ日時 2024-04-14 05:40:08
合計ジャッジ時間 32,119 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,422 ms
80,396 KB
testcase_01 AC 1,411 ms
80,640 KB
testcase_02 AC 1,411 ms
80,416 KB
testcase_03 AC 1,407 ms
80,524 KB
testcase_04 AC 1,406 ms
80,144 KB
testcase_05 AC 1,414 ms
80,492 KB
testcase_06 AC 1,410 ms
80,284 KB
testcase_07 AC 1,430 ms
80,288 KB
testcase_08 AC 1,400 ms
80,144 KB
testcase_09 AC 1,414 ms
80,276 KB
testcase_10 AC 1,371 ms
80,840 KB
testcase_11 AC 1,378 ms
80,344 KB
testcase_12 AC 1,389 ms
80,488 KB
testcase_13 AC 1,388 ms
80,212 KB
testcase_14 AC 1,410 ms
80,372 KB
testcase_15 AC 1,400 ms
80,364 KB
testcase_16 AC 1,392 ms
80,884 KB
testcase_17 AC 1,392 ms
80,884 KB
testcase_18 AC 1,417 ms
80,992 KB
testcase_19 AC 109 ms
76,976 KB
testcase_20 AC 111 ms
77,024 KB
testcase_21 AC 111 ms
76,868 KB
testcase_22 AC 108 ms
76,712 KB
testcase_23 AC 111 ms
76,836 KB
testcase_24 AC 115 ms
76,992 KB
testcase_25 AC 109 ms
76,832 KB
testcase_26 AC 109 ms
77,092 KB
testcase_27 AC 109 ms
77,284 KB
testcase_28 AC 45 ms
60,524 KB
testcase_29 AC 41 ms
54,072 KB
testcase_30 AC 46 ms
60,996 KB
testcase_31 AC 46 ms
61,280 KB
testcase_32 AC 46 ms
60,916 KB
testcase_33 AC 46 ms
61,000 KB
testcase_34 AC 46 ms
60,068 KB
testcase_35 AC 46 ms
60,980 KB
testcase_36 AC 46 ms
61,860 KB
testcase_37 AC 47 ms
60,156 KB
testcase_38 AC 46 ms
60,768 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 = i
        yaku2 = 1
        for p in primes:
            cnt = 0
            while tmp % p == 0:
                tmp = tmp //p
                cnt += 1
            yaku2 *= (dic[p]+1+cnt)
        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