結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー tassei903
提出日時 2021-07-21 22:08:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,173 bytes
コンパイル時間 303 ms
コンパイル使用メモリ 82,296 KB
実行使用メモリ 77,756 KB
最終ジャッジ日時 2024-07-17 18:45:06
合計ジャッジ時間 6,241 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 9 WA * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
sys.setrecursionlimit(10**7)
yes = lambda :print("yes");Yes = lambda :print("Yes")
no = lambda :print("no");No = lambda :print("No")
#######################################################################

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

pl = [2,3,5,7,11,13,17,19,23,29,31,37,41]
dl = dict()
for i, x in enumerate(pl):
    dl[x] = i
    
z = len(pl)
T = ni()

def f(x,y):
    r = 0
    while x>0:
        if x%y:
            break
        x//=y
        r+=1
    return r

from collections import defaultdict
for i in range(T):
    x = ni()
    ans = 10**15
    for j in pl:
        ff = f(x,j)
        if ff==0:
            ans = min(ans,j)
            break
        else:
            ans = min(ans,pow(j,ff+1))
    print(x*ans)
0