結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー tassei903tassei903
提出日時 2021-10-30 10:50:36
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,170 bytes
コンパイル時間 329 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 89,600 KB
最終ジャッジ日時 2024-04-16 16:14:35
合計ジャッジ時間 21,766 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 1,130 ms
87,680 KB
testcase_02 AC 1,117 ms
87,424 KB
testcase_03 AC 1,082 ms
86,784 KB
testcase_04 AC 1,109 ms
86,528 KB
testcase_05 AC 1,120 ms
87,296 KB
testcase_06 AC 1,047 ms
86,912 KB
testcase_07 AC 1,128 ms
87,424 KB
testcase_08 AC 1,120 ms
87,808 KB
testcase_09 AC 1,033 ms
85,888 KB
testcase_10 AC 283 ms
79,488 KB
testcase_11 AC 276 ms
79,232 KB
testcase_12 AC 256 ms
78,720 KB
testcase_13 AC 278 ms
78,720 KB
testcase_14 AC 275 ms
78,592 KB
testcase_15 AC 281 ms
79,744 KB
testcase_16 AC 262 ms
78,848 KB
testcase_17 AC 256 ms
78,464 KB
testcase_18 AC 262 ms
78,848 KB
testcase_19 AC 76 ms
68,096 KB
testcase_20 AC 68 ms
65,152 KB
testcase_21 AC 78 ms
67,328 KB
testcase_22 AC 70 ms
65,664 KB
testcase_23 AC 69 ms
65,792 KB
testcase_24 AC 75 ms
67,328 KB
testcase_25 AC 75 ms
67,584 KB
testcase_26 AC 81 ms
70,784 KB
testcase_27 AC 74 ms
67,200 KB
testcase_28 AC 42 ms
51,968 KB
testcase_29 AC 42 ms
51,840 KB
testcase_30 AC 42 ms
51,968 KB
testcase_31 AC 43 ms
51,840 KB
testcase_32 AC 41 ms
52,224 KB
testcase_33 AC 42 ms
52,608 KB
testcase_34 AC 42 ms
51,840 KB
testcase_35 AC 41 ms
52,096 KB
testcase_36 AC 41 ms
52,096 KB
testcase_37 AC 41 ms
52,224 KB
testcase_38 AC 42 ms
52,224 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]
    


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