結果
| 問題 |
No.1330 Multiply or Divide
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-09-13 12:42:32 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 436 bytes |
| コンパイル時間 | 146 ms |
| コンパイル使用メモリ | 82,372 KB |
| 実行使用メモリ | 116,032 KB |
| 最終ジャッジ日時 | 2024-06-30 21:40:46 |
| 合計ジャッジ時間 | 5,295 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 39 WA * 7 |
ソースコード
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)