結果
| 問題 |
No.1330 Multiply or Divide
|
| コンテスト | |
| ユーザー |
persimmon_t01
|
| 提出日時 | 2021-01-08 21:45:18 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 264 bytes |
| コンパイル時間 | 594 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 103,936 KB |
| 最終ジャッジ日時 | 2024-11-16 11:02:06 |
| 合計ジャッジ時間 | 5,236 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 39 WA * 7 |
ソースコード
n,m,p=map(int,input().split())
a=list(map(int,input().split()))
ma0=max(a)
for i in range(n):
if a[i]>m:
print(1)
exit()
while a[i]%p==0:a[i]//=p
ma1=max(a)
if ma1==1:
print(-1)
exit()
now=1
ans=0
while now*ma0<=m:
now*=ma1
ans+=1
print(ans+1)
persimmon_t01