結果

問題 No.1330 Multiply or Divide
ユーザー ryuusagi
提出日時 2021-01-08 22:31:23
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 270 bytes
コンパイル時間 431 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 113,152 KB
最終ジャッジ日時 2024-11-16 13:24:09
合計ジャッジ時間 5,554 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 39 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,p,*a=map(int,open(0).read().split())
a.sort(reverse=True)
for i in a:
    if i%p!=0 and i!=1:
        break
x=1
j=0
while x<=m:
    if x*max(a)>m:
        print(j+1)
        exit(0)
    elif i%p==0 or i==1:
        print(-1)
        exit()
    x*=i
    j+=1
print(j)
0