結果

問題 No.1330 Multiply or Divide
コンテスト
ユーザー aqua_tenhou
提出日時 2021-01-08 21:33:41
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 338 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 82,028 KB
実行使用メモリ 104,712 KB
最終ジャッジ日時 2024-11-16 10:25:38
合計ジャッジ時間 4,689 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34 WA * 12
権限があれば一括ダウンロードができます

ソースコード

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