結果
| 問題 | No.1330 Multiply or Divide |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-09-13 12:42:32 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 436 bytes |
| 記録 | |
| コンパイル時間 | 340 ms |
| コンパイル使用メモリ | 84,876 KB |
| 実行使用メモリ | 121,248 KB |
| 最終ジャッジ日時 | 2026-03-21 07:59:37 |
| 合計ジャッジ時間 | 3,992 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 40 WA * 11 |
ソースコード
from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline
N,M,P = map(int,input().split())
A = list(map(int,input().split()))
B = []
for a in A:
while a%P==0:
a //= P
B.append(a)
L = max(B)
S = max(A)
if S>M:
print(1)
exit()
if L==1:
print(-1)
exit()
now = S
cnt = 1
while now <= M:
cnt += 1
now *= L
print(cnt)