結果
| 問題 | No.1330 Multiply or Divide |
| コンテスト | |
| ユーザー |
H20
|
| 提出日時 | 2021-01-08 22:17:33 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 437 bytes |
| 記録 | |
| コンパイル時間 | 233 ms |
| コンパイル使用メモリ | 85,632 KB |
| 実行使用メモリ | 93,184 KB |
| 最終ジャッジ日時 | 2026-05-11 18:59:16 |
| 合計ジャッジ時間 | 7,280 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 50 |
ソースコード
N,M,P = map(int, input().split())
A = list(map(int, input().split()))
divA = [0]*N
cntDiv = [0]*N
maxA = max(A)
if maxA>M:
print(1)
exit()
aaa=0
for i in range(N):
cnt = 0
temp = A[i]
while temp % P ==0:
temp=temp//P
cnt+=1
divA[i]=temp
cntDiv[i]=cnt
aaa=max(aaa,temp/(cnt+1))
if divA.count(1)==N:
print(-1)
exit()
cnt = 1
x = 1
while maxA*x<M:
cnt+=1
x*=aaa
print(cnt)
H20