結果

問題 No.1330 Multiply or Divide
ユーザー googol_S0googol_S0
提出日時 2021-01-08 21:29:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 370 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 82,252 KB
実行使用メモリ 146,008 KB
最終ジャッジ日時 2024-04-28 02:05:39
合計ジャッジ時間 14,203 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 446 ms
124,072 KB
testcase_02 AC 37 ms
51,968 KB
testcase_03 AC 39 ms
52,096 KB
testcase_04 AC 37 ms
51,968 KB
testcase_05 AC 38 ms
52,096 KB
testcase_06 AC 96 ms
127,360 KB
testcase_07 AC 178 ms
129,192 KB
testcase_08 AC 703 ms
145,568 KB
testcase_09 AC 723 ms
145,312 KB
testcase_10 AC 708 ms
146,008 KB
testcase_11 AC 724 ms
145,484 KB
testcase_12 AC 701 ms
145,560 KB
testcase_13 AC 39 ms
52,608 KB
testcase_14 AC 39 ms
52,480 KB
testcase_15 AC 38 ms
52,480 KB
testcase_16 AC 37 ms
52,352 KB
testcase_17 AC 38 ms
52,480 KB
testcase_18 AC 684 ms
145,748 KB
testcase_19 AC 706 ms
145,492 KB
testcase_20 AC 708 ms
145,168 KB
testcase_21 AC 686 ms
145,284 KB
testcase_22 AC 704 ms
145,488 KB
testcase_23 WA -
testcase_24 AC 39 ms
52,096 KB
testcase_25 AC 38 ms
52,352 KB
testcase_26 WA -
testcase_27 AC 39 ms
52,224 KB
testcase_28 AC 38 ms
52,608 KB
testcase_29 AC 39 ms
52,096 KB
testcase_30 AC 38 ms
52,224 KB
testcase_31 AC 39 ms
52,352 KB
testcase_32 AC 39 ms
52,736 KB
testcase_33 AC 38 ms
52,448 KB
testcase_34 AC 514 ms
122,624 KB
testcase_35 AC 167 ms
89,344 KB
testcase_36 AC 454 ms
117,780 KB
testcase_37 AC 412 ms
113,792 KB
testcase_38 AC 272 ms
102,272 KB
testcase_39 AC 196 ms
91,904 KB
testcase_40 AC 230 ms
96,804 KB
testcase_41 AC 135 ms
84,608 KB
testcase_42 AC 383 ms
110,336 KB
testcase_43 AC 424 ms
113,664 KB
testcase_44 AC 133 ms
134,912 KB
testcase_45 AC 135 ms
135,044 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