結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー tassei903tassei903
提出日時 2021-07-21 23:07:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,180 bytes
コンパイル時間 894 ms
コンパイル使用メモリ 87,024 KB
実行使用メモリ 81,808 KB
最終ジャッジ日時 2023-09-24 19:36:25
合計ジャッジ時間 12,147 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 95 ms
76,212 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 97 ms
76,392 KB
testcase_28 AC 74 ms
71,464 KB
testcase_29 AC 73 ms
70,976 KB
testcase_30 AC 75 ms
71,208 KB
testcase_31 AC 74 ms
71,396 KB
testcase_32 AC 75 ms
71,392 KB
testcase_33 AC 74 ms
71,300 KB
testcase_34 AC 74 ms
70,972 KB
testcase_35 AC 74 ms
71,528 KB
testcase_36 AC 74 ms
71,340 KB
testcase_37 AC 74 ms
71,480 KB
testcase_38 AC 73 ms
71,312 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:
        s = s*(z[x][2]+t+1)//(z[x][2]+t)
        r *= z[x][1]
        saiki(x+1, s, r)
        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