結果

問題 No.1330 Multiply or Divide
ユーザー persimmon-persimmonpersimmon-persimmon
提出日時 2021-02-14 07:56:33
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 288 bytes
コンパイル時間 854 ms
コンパイル使用メモリ 86,688 KB
実行使用メモリ 109,216 KB
最終ジャッジ日時 2023-09-28 18:36:16
合計ジャッジ時間 9,525 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 130 ms
109,216 KB
testcase_02 AC 76 ms
71,332 KB
testcase_03 AC 74 ms
71,228 KB
testcase_04 AC 74 ms
71,316 KB
testcase_05 AC 72 ms
71,136 KB
testcase_06 AC 119 ms
106,036 KB
testcase_07 WA -
testcase_08 AC 145 ms
101,660 KB
testcase_09 AC 145 ms
101,424 KB
testcase_10 AC 144 ms
101,700 KB
testcase_11 AC 140 ms
101,328 KB
testcase_12 AC 142 ms
101,664 KB
testcase_13 AC 75 ms
71,312 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 72 ms
71,204 KB
testcase_17 WA -
testcase_18 AC 130 ms
101,236 KB
testcase_19 AC 129 ms
101,156 KB
testcase_20 AC 129 ms
101,128 KB
testcase_21 AC 129 ms
101,140 KB
testcase_22 AC 128 ms
100,844 KB
testcase_23 AC 133 ms
100,920 KB
testcase_24 AC 74 ms
71,088 KB
testcase_25 AC 73 ms
71,304 KB
testcase_26 AC 75 ms
71,288 KB
testcase_27 AC 73 ms
71,160 KB
testcase_28 AC 73 ms
71,128 KB
testcase_29 AC 74 ms
71,148 KB
testcase_30 AC 75 ms
71,168 KB
testcase_31 AC 73 ms
71,188 KB
testcase_32 AC 74 ms
71,012 KB
testcase_33 AC 74 ms
71,276 KB
testcase_34 AC 115 ms
102,400 KB
testcase_35 AC 90 ms
81,252 KB
testcase_36 AC 108 ms
99,044 KB
testcase_37 AC 104 ms
96,168 KB
testcase_38 AC 95 ms
87,584 KB
testcase_39 AC 92 ms
82,476 KB
testcase_40 AC 93 ms
84,704 KB
testcase_41 AC 85 ms
79,248 KB
testcase_42 AC 102 ms
93,932 KB
testcase_43 AC 106 ms
96,588 KB
testcase_44 WA -
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,p=map(int,input().split())
a=list(map(int,input().split()))
if any([x>m for x in a]):
  print(1)
  exit()
bd=m
mxv=0
for x in a:
  bd=min(bd,(m+1+x-1)//x)
  while x%p==0:x//=p
  mxv=max(mxv,x)
if mxv==1:
  print(-1)
  exit()
now=1
ans=0
while now<=bd:
  now*=mxv
  ans+=1
print(ans+1)
0