結果

問題 No.1330 Multiply or Divide
ユーザー persimmon-persimmonpersimmon-persimmon
提出日時 2021-02-14 07:59:47
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 319 bytes
コンパイル時間 1,786 ms
コンパイル使用メモリ 86,712 KB
実行使用メモリ 109,208 KB
最終ジャッジ日時 2023-09-28 18:40:43
合計ジャッジ時間 7,996 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 133 ms
109,208 KB
testcase_02 AC 74 ms
71,300 KB
testcase_03 AC 74 ms
71,136 KB
testcase_04 AC 75 ms
71,068 KB
testcase_05 AC 75 ms
71,072 KB
testcase_06 AC 119 ms
106,044 KB
testcase_07 WA -
testcase_08 AC 148 ms
101,648 KB
testcase_09 AC 150 ms
101,704 KB
testcase_10 AC 149 ms
101,664 KB
testcase_11 AC 147 ms
101,592 KB
testcase_12 AC 148 ms
101,900 KB
testcase_13 AC 75 ms
71,300 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 78 ms
71,228 KB
testcase_17 WA -
testcase_18 AC 137 ms
101,312 KB
testcase_19 AC 135 ms
101,292 KB
testcase_20 AC 135 ms
101,168 KB
testcase_21 AC 134 ms
101,144 KB
testcase_22 AC 133 ms
101,444 KB
testcase_23 AC 136 ms
101,188 KB
testcase_24 AC 76 ms
71,340 KB
testcase_25 AC 75 ms
71,080 KB
testcase_26 AC 76 ms
71,248 KB
testcase_27 AC 76 ms
71,340 KB
testcase_28 AC 77 ms
71,208 KB
testcase_29 AC 75 ms
71,084 KB
testcase_30 AC 76 ms
71,224 KB
testcase_31 AC 76 ms
71,316 KB
testcase_32 AC 77 ms
71,296 KB
testcase_33 AC 76 ms
71,428 KB
testcase_34 AC 118 ms
102,548 KB
testcase_35 AC 89 ms
81,408 KB
testcase_36 AC 112 ms
98,988 KB
testcase_37 AC 105 ms
96,140 KB
testcase_38 AC 97 ms
87,308 KB
testcase_39 AC 91 ms
82,268 KB
testcase_40 AC 96 ms
84,908 KB
testcase_41 AC 89 ms
79,120 KB
testcase_42 AC 106 ms
94,044 KB
testcase_43 AC 110 ms
96,832 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
if now>m:
  print(ans)
else:
  print(ans+1)
0