結果

問題 No.1330 Multiply or Divide
ユーザー wolgnik
提出日時 2021-01-08 21:38:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 282 bytes
コンパイル時間 192 ms
コンパイル使用メモリ 82,816 KB
実行使用メモリ 101,760 KB
最終ジャッジ日時 2024-11-16 10:41:16
合計ジャッジ時間 5,276 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 38 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
N, M, P = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
x = 1
for i in range(40):
  if x > M:
    print(i)
    break

  for j in range(N - 1, -1, -1):
    if (x * a[j]) % P:
      x *= a[j]
      break
else:
  print(-1)
0