結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー tassei903tassei903
提出日時 2021-07-22 05:06:47
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,179 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 82,288 KB
実行使用メモリ 89,156 KB
最終ジャッジ日時 2024-04-14 05:35:55
合計ジャッジ時間 19,086 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 1,046 ms
88,156 KB
testcase_02 AC 1,037 ms
87,032 KB
testcase_03 AC 1,009 ms
87,188 KB
testcase_04 AC 1,016 ms
86,472 KB
testcase_05 AC 1,027 ms
87,328 KB
testcase_06 AC 975 ms
87,292 KB
testcase_07 AC 1,050 ms
87,420 KB
testcase_08 AC 1,051 ms
87,996 KB
testcase_09 AC 979 ms
85,668 KB
testcase_10 AC 267 ms
80,108 KB
testcase_11 AC 253 ms
79,256 KB
testcase_12 AC 235 ms
79,064 KB
testcase_13 AC 260 ms
78,704 KB
testcase_14 AC 255 ms
78,704 KB
testcase_15 AC 263 ms
79,988 KB
testcase_16 AC 247 ms
78,676 KB
testcase_17 AC 239 ms
78,248 KB
testcase_18 AC 246 ms
78,396 KB
testcase_19 AC 63 ms
69,708 KB
testcase_20 AC 59 ms
67,260 KB
testcase_21 AC 63 ms
68,340 KB
testcase_22 AC 59 ms
66,352 KB
testcase_23 AC 59 ms
66,812 KB
testcase_24 AC 63 ms
69,536 KB
testcase_25 AC 63 ms
68,736 KB
testcase_26 AC 68 ms
71,984 KB
testcase_27 AC 63 ms
68,088 KB
testcase_28 AC 38 ms
52,516 KB
testcase_29 AC 37 ms
53,292 KB
testcase_30 AC 38 ms
53,928 KB
testcase_31 AC 37 ms
52,744 KB
testcase_32 AC 37 ms
52,752 KB
testcase_33 AC 36 ms
52,872 KB
testcase_34 AC 38 ms
52,528 KB
testcase_35 AC 36 ms
53,504 KB
testcase_36 AC 37 ms
53,532 KB
testcase_37 AC 38 ms
52,468 KB
testcase_38 AC 37 ms
52,628 KB
権限があれば一括ダウンロードができます

ソースコード

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")
#######################################################################



pl = [2,3,5,7,11,13,17,19,23,29,31,37,41,43]
    


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

def saiki(x, s, r):
    global S, ans
    #print(x,s,r)
    if s==S*2:
        #print(x,s,r)
        ans = min(ans, r)
    elif s>S*2:
        return 0
    t = 1
    if x>=len(z):
        return 0
    while s<=S*2 and r<=ans:
        saiki(x+1, s, r)
        s = s*(z[x][2]+t+1)//(z[x][2]+t)
        r *= z[x][1]
        t+=1
        
    

T = ni()
for i in range(T):
    x = ni()
    ans = 10**15
    z = []
    for t,j in enumerate(pl):
        ff = f(x,j)
        if ff>0:
            z.append((t, j, ff))
        if ff==0:
            mp = j
            mt = t
            ans = j
            break
    S = 1
    for i in z:
        S*=i[2]+1
    saiki(0, S, 1)
    print(x*ans)
0