結果
| 問題 | No.1330 Multiply or Divide |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-02-14 07:59:47 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 319 bytes |
| 記録 | |
| コンパイル時間 | 216 ms |
| コンパイル使用メモリ | 85,160 KB |
| 実行使用メモリ | 115,124 KB |
| 最終ジャッジ日時 | 2026-04-03 04:48:17 |
| 合計ジャッジ時間 | 9,884 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge5_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 40 WA * 11 |
ソースコード
n,m,p=map(int,input().split()) a=list(map(int,input().split())) if any([x>m for x in a]): print(1) exit() bd=m mxv=0 for x in a: bd=min(bd,(m+1+x-1)//x) while x%p==0:x//=p mxv=max(mxv,x) if mxv==1: print(-1) exit() now=1 ans=0 while now<=bd: now*=mxv ans+=1 if now>m: print(ans) else: print(ans+1)