結果

問題 No.1330 Multiply or Divide
ユーザー googol_S0googol_S0
提出日時 2021-01-08 21:34:29
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 371 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 81,760 KB
実行使用メモリ 145,816 KB
最終ジャッジ日時 2024-04-28 05:42:34
合計ジャッジ時間 15,162 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 481 ms
124,304 KB
testcase_02 AC 41 ms
53,888 KB
testcase_03 AC 40 ms
53,816 KB
testcase_04 AC 44 ms
52,124 KB
testcase_05 AC 40 ms
52,448 KB
testcase_06 AC 103 ms
127,668 KB
testcase_07 AC 184 ms
129,668 KB
testcase_08 AC 725 ms
145,816 KB
testcase_09 AC 750 ms
145,192 KB
testcase_10 AC 730 ms
145,428 KB
testcase_11 AC 757 ms
145,488 KB
testcase_12 AC 755 ms
145,680 KB
testcase_13 AC 43 ms
52,888 KB
testcase_14 AC 42 ms
52,716 KB
testcase_15 AC 42 ms
52,352 KB
testcase_16 AC 43 ms
52,352 KB
testcase_17 AC 43 ms
52,224 KB
testcase_18 AC 733 ms
145,292 KB
testcase_19 AC 732 ms
145,240 KB
testcase_20 AC 721 ms
145,628 KB
testcase_21 AC 701 ms
145,444 KB
testcase_22 AC 780 ms
145,308 KB
testcase_23 AC 494 ms
145,228 KB
testcase_24 AC 43 ms
52,404 KB
testcase_25 AC 44 ms
52,736 KB
testcase_26 AC 42 ms
52,224 KB
testcase_27 AC 43 ms
52,224 KB
testcase_28 AC 43 ms
52,352 KB
testcase_29 AC 43 ms
52,480 KB
testcase_30 AC 43 ms
51,968 KB
testcase_31 AC 39 ms
52,480 KB
testcase_32 AC 40 ms
52,096 KB
testcase_33 AC 40 ms
52,224 KB
testcase_34 AC 558 ms
122,624 KB
testcase_35 AC 189 ms
89,600 KB
testcase_36 AC 499 ms
117,760 KB
testcase_37 AC 435 ms
113,860 KB
testcase_38 AC 284 ms
101,888 KB
testcase_39 AC 208 ms
91,904 KB
testcase_40 AC 236 ms
96,904 KB
testcase_41 AC 153 ms
84,832 KB
testcase_42 AC 413 ms
110,148 KB
testcase_43 AC 455 ms
113,792 KB
testcase_44 AC 137 ms
134,784 KB
testcase_45 AC 141 ms
135,040 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]**10)**(1/x[1])))
P=0
Y=1
while Y*Z<=M:
  Y*=D[-1][0]
  P+=D[-1][1]
print(P+1)
0