結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー googol_S0
提出日時 2021-07-21 21:25:20
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 467 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 82,376 KB
実行使用メモリ 89,292 KB
最終ジャッジ日時 2024-07-17 15:58:47
合計ジャッジ時間 15,566 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 9 WA * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

P=[]
M=10**6
F=[0]*(M+1)
for i in range(2,M+1):
  if F[i]:
    continue
  P.append(i)
  for j in range(i*2,M+1,i):
    F[j]=1
def solve():
  X=int(input())
  M=P[100]
  Y=[]
  for i in range(100):
    if X%P[i]!=0:
      M=min(M,P[i])
    else:
      x=X
      Y.append([P[i],0])
      while x%P[i]==0:
        x//=P[i]
        Y[-1][1]+=1
  ANS=M
  for i in range(len(Y)):
    ANS=min(ANS,Y[i][0]**(Y[i][1]+1))
  print(ANS*X)

for t in range(int(input())):
  solve()
0