結果
| 問題 | No.1330 Multiply or Divide |
| コンテスト | |
| ユーザー |
persimmon_t01
|
| 提出日時 | 2021-01-08 21:45:18 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 264 bytes |
| 記録 | |
| コンパイル時間 | 146 ms |
| コンパイル使用メモリ | 85,248 KB |
| 実行使用メモリ | 111,232 KB |
| 最終ジャッジ日時 | 2026-05-11 17:37:21 |
| 合計ジャッジ時間 | 3,917 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 40 WA * 11 |
ソースコード
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