結果

問題 No.1330 Multiply or Divide
ユーザー googol_S0googol_S0
提出日時 2021-01-08 21:25:32
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 364 bytes
コンパイル時間 126 ms
コンパイル使用メモリ 82,072 KB
実行使用メモリ 147,868 KB
最終ジャッジ日時 2024-04-28 01:57:15
合計ジャッジ時間 7,727 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 151 ms
129,108 KB
testcase_02 AC 35 ms
51,968 KB
testcase_03 AC 33 ms
52,224 KB
testcase_04 AC 33 ms
52,096 KB
testcase_05 AC 31 ms
52,608 KB
testcase_06 AC 87 ms
126,464 KB
testcase_07 AC 165 ms
129,520 KB
testcase_08 AC 330 ms
145,564 KB
testcase_09 AC 318 ms
145,320 KB
testcase_10 AC 310 ms
145,324 KB
testcase_11 AC 333 ms
145,664 KB
testcase_12 AC 330 ms
145,500 KB
testcase_13 AC 33 ms
52,480 KB
testcase_14 AC 31 ms
52,096 KB
testcase_15 AC 31 ms
51,840 KB
testcase_16 AC 31 ms
52,096 KB
testcase_17 AC 30 ms
52,340 KB
testcase_18 AC 325 ms
147,404 KB
testcase_19 AC 328 ms
147,616 KB
testcase_20 AC 337 ms
147,804 KB
testcase_21 AC 329 ms
147,868 KB
testcase_22 AC 325 ms
147,612 KB
testcase_23 WA -
testcase_24 AC 34 ms
52,352 KB
testcase_25 AC 32 ms
52,224 KB
testcase_26 WA -
testcase_27 AC 31 ms
51,968 KB
testcase_28 AC 30 ms
51,840 KB
testcase_29 AC 31 ms
52,736 KB
testcase_30 AC 32 ms
52,352 KB
testcase_31 AC 32 ms
52,096 KB
testcase_32 AC 32 ms
52,608 KB
testcase_33 AC 31 ms
52,608 KB
testcase_34 AC 220 ms
122,368 KB
testcase_35 AC 80 ms
83,200 KB
testcase_36 AC 191 ms
117,632 KB
testcase_37 AC 179 ms
113,792 KB
testcase_38 AC 130 ms
101,760 KB
testcase_39 AC 104 ms
93,632 KB
testcase_40 AC 116 ms
97,024 KB
testcase_41 AC 72 ms
77,440 KB
testcase_42 AC 171 ms
109,952 KB
testcase_43 AC 188 ms
113,712 KB
testcase_44 AC 122 ms
134,528 KB
testcase_45 AC 120 ms
134,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,P=map(int,input().split())
A=list(map(int,input().split()))
B=[]
C=[]
for i in range(N):
  B.append(A[i])
  C.append(1)
  while B[i]%P==0:
    B[i]//=P
    C[i]+=1
Z=max(A)
X=(M+Z-1)//Z
if max(B)==1 and X>1:
  print(-1)
  exit()
D=[[B[i],C[i]] for i in range(N)]
D.sort(key=lambda x:(x[0]**(1/x[1])))
P=0
Y=1
while Y*Z<M:
  Y*=D[-1][0]
  P+=D[-1][1]
print(P+1)
0