結果
| 問題 | No.1330 Multiply or Divide |
| コンテスト | |
| ユーザー |
H20
|
| 提出日時 | 2021-01-08 22:17:33 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 437 bytes |
| 記録 | |
| コンパイル時間 | 68 ms |
| コンパイル使用メモリ | 82,364 KB |
| 実行使用メモリ | 82,340 KB |
| 最終ジャッジ日時 | 2026-09-24 15:55:10 |
| 合計ジャッジ時間 | 11,676 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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