結果

問題 No.1330 Multiply or Divide
ユーザー aqua_tenhou
提出日時 2021-01-08 21:52:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 338 bytes
コンパイル時間 556 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 103,808 KB
最終ジャッジ日時 2024-11-16 11:18:18
合計ジャッジ時間 5,173 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 39 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,p = map(int,input().split())
a = list(map(int,input().split()))
m_a = max(a)

s = -1
for x in a:
    if x%p == 0:
        pass
    else:
        s = max(s, x)
if s == -1:
    if m_a > m:
        print(1)
    else:
        print(-1)
else:
    ans = 1
    x = 1
    while x*m_a <= m:
        x *= s
        ans += 1
    print(ans)
    
0