結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2021-07-21 21:57:07
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 1,566 bytes
コンパイル時間 772 ms
コンパイル使用メモリ 87,136 KB
実行使用メモリ 90,172 KB
最終ジャッジ日時 2023-09-24 17:20:14
合計ジャッジ時間 7,980 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

6 = 2 * 3
24 = 2*2*2*6

2*2

2->4

2倍を素因数分解する

A * B * C

最小の含まれない素因数は割と小さいはず
それ以下に関して、探索する

31以下

2*3*5*7*11*13*17*19*23*29*31
で、10個

この内、積で31未満の物

4
8
16
9
27
25


"""

from sys import stdin
import sys
from collections import deque

def Sieve(n): #n以下の素数全列挙(O(nloglogn)) retは素数が入ってる。divlisはその数字の素因数が一つ入ってる

    ret = []
    divlis = [-1] * (n+1) #何で割ったかのリスト(初期値は-1)
    
    flag = [True] * (n+1)
    flag[0] = False
    flag[1] = False

    ind = 2
    while ind <= n:

        if flag[ind]:
            ret.append(ind)

            ind2 = ind ** 2

            while ind2 <= n:
                flag[ind2] = False
                divlis[ind2] = ind
                ind2 += ind

        ind += 1

    return ret,divlis

plis,tmp = Sieve(32)
#print (plis)

tt = int(stdin.readline())

for loop in range(tt):

    X = int(stdin.readline())

    ans = float("inf")

    for i in range(1,32):

        NY = X * i

        XN = 1
        TX = X
        for p in plis:
            now = 1
            while TX % p == 0:
                now += 1
                TX //= p
            XN *= now

        YN = 1
        TY = NY
        for p in plis:
            now = 1
            while TY % p == 0:
                now += 1
                TY //= p
            YN *= now

        if YN == XN * 2 and NY % X == 0:
            ans = min(ans,NY)

    print (ans)
0