結果

問題 No.1330 Multiply or Divide
ユーザー marroncastlemarroncastle
提出日時 2021-01-20 19:10:58
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 331 bytes
コンパイル時間 1,019 ms
コンパイル使用メモリ 86,736 KB
実行使用メモリ 107,304 KB
最終ジャッジ日時 2023-08-24 23:14:06
合計ジャッジ時間 8,982 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 135 ms
107,096 KB
testcase_02 WA -
testcase_03 AC 72 ms
71,136 KB
testcase_04 AC 71 ms
71,212 KB
testcase_05 AC 73 ms
70,956 KB
testcase_06 AC 108 ms
104,316 KB
testcase_07 WA -
testcase_08 AC 132 ms
100,216 KB
testcase_09 AC 136 ms
100,268 KB
testcase_10 AC 132 ms
100,372 KB
testcase_11 AC 131 ms
100,372 KB
testcase_12 AC 133 ms
100,328 KB
testcase_13 AC 73 ms
71,076 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 72 ms
70,840 KB
testcase_17 WA -
testcase_18 AC 126 ms
100,236 KB
testcase_19 AC 126 ms
100,388 KB
testcase_20 AC 125 ms
100,408 KB
testcase_21 AC 124 ms
100,212 KB
testcase_22 AC 124 ms
100,388 KB
testcase_23 AC 125 ms
99,592 KB
testcase_24 AC 72 ms
70,948 KB
testcase_25 AC 72 ms
71,168 KB
testcase_26 AC 72 ms
71,040 KB
testcase_27 AC 71 ms
71,036 KB
testcase_28 AC 72 ms
70,940 KB
testcase_29 AC 71 ms
71,132 KB
testcase_30 AC 71 ms
71,152 KB
testcase_31 AC 71 ms
71,244 KB
testcase_32 AC 70 ms
71,304 KB
testcase_33 AC 71 ms
71,144 KB
testcase_34 AC 107 ms
101,096 KB
testcase_35 AC 82 ms
81,224 KB
testcase_36 AC 103 ms
97,976 KB
testcase_37 AC 100 ms
95,292 KB
testcase_38 AC 90 ms
87,176 KB
testcase_39 AC 84 ms
82,340 KB
testcase_40 AC 86 ms
84,648 KB
testcase_41 AC 79 ms
79,004 KB
testcase_42 AC 98 ms
93,172 KB
testcase_43 AC 99 ms
95,840 KB
testcase_44 WA -
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M, P = map(int, input().split())
A = list(map(int, input().split()))
maxa = max(A)
for i in range(N):
  while A[i]%P==0:
    A[i] //= P
maxa2 = max(A)
ans = 0
x = 1
if M==1:
  print(0)
else:
  while x<=M:
    ans += 1
    if x*maxa>M:
      break
    if ans>1 and maxa2==1:
      ans = -1
      break
    x *= maxa2
  print(ans)
0