結果
| 問題 |
No.1330 Multiply or Divide
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-09-13 12:40:59 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 430 bytes |
| コンパイル時間 | 247 ms |
| コンパイル使用メモリ | 81,980 KB |
| 実行使用メモリ | 116,000 KB |
| 最終ジャッジ日時 | 2024-06-30 21:39:39 |
| 合計ジャッジ時間 | 6,395 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)
if max(A)>M:
print(1)
exit()
if L==1:
print(-1)
exit()
now = 1
cnt = 0
while now <= M:
cnt += 1
now *= L
print(cnt)