結果

問題 No.1330 Multiply or Divide
ユーザー googol_S0googol_S0
提出日時 2021-01-08 21:34:29
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 371 bytes
コンパイル時間 1,997 ms
コンパイル使用メモリ 86,420 KB
実行使用メモリ 148,704 KB
最終ジャッジ日時 2023-08-10 12:25:29
合計ジャッジ時間 17,216 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 586 ms
124,596 KB
testcase_02 AC 72 ms
71,084 KB
testcase_03 AC 72 ms
71,328 KB
testcase_04 AC 72 ms
71,164 KB
testcase_05 AC 73 ms
71,264 KB
testcase_06 AC 131 ms
131,708 KB
testcase_07 AC 215 ms
128,084 KB
testcase_08 AC 779 ms
145,504 KB
testcase_09 AC 767 ms
144,180 KB
testcase_10 AC 783 ms
145,160 KB
testcase_11 AC 775 ms
145,320 KB
testcase_12 AC 778 ms
145,968 KB
testcase_13 AC 74 ms
71,720 KB
testcase_14 AC 72 ms
71,440 KB
testcase_15 AC 73 ms
71,440 KB
testcase_16 AC 73 ms
71,432 KB
testcase_17 AC 73 ms
71,636 KB
testcase_18 AC 764 ms
146,692 KB
testcase_19 AC 766 ms
146,816 KB
testcase_20 AC 747 ms
146,696 KB
testcase_21 AC 758 ms
146,924 KB
testcase_22 AC 723 ms
146,640 KB
testcase_23 AC 518 ms
148,704 KB
testcase_24 AC 75 ms
71,632 KB
testcase_25 AC 73 ms
71,344 KB
testcase_26 AC 73 ms
71,408 KB
testcase_27 AC 71 ms
71,348 KB
testcase_28 AC 72 ms
71,328 KB
testcase_29 AC 72 ms
71,208 KB
testcase_30 AC 72 ms
71,348 KB
testcase_31 AC 71 ms
71,568 KB
testcase_32 AC 71 ms
71,592 KB
testcase_33 AC 73 ms
71,328 KB
testcase_34 AC 555 ms
113,268 KB
testcase_35 AC 191 ms
90,028 KB
testcase_36 AC 503 ms
109,384 KB
testcase_37 AC 451 ms
112,928 KB
testcase_38 AC 302 ms
100,944 KB
testcase_39 AC 224 ms
92,532 KB
testcase_40 AC 259 ms
96,796 KB
testcase_41 AC 167 ms
85,568 KB
testcase_42 AC 420 ms
108,960 KB
testcase_43 AC 463 ms
112,160 KB
testcase_44 AC 195 ms
133,784 KB
testcase_45 AC 194 ms
133,892 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