結果
| 問題 |
No.1330 Multiply or Divide
|
| コンテスト | |
| ユーザー |
persimmon_t01
|
| 提出日時 | 2021-01-08 21:36:20 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 244 bytes |
| コンパイル時間 | 238 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 103,808 KB |
| 最終ジャッジ日時 | 2024-11-16 10:35:05 |
| 合計ジャッジ時間 | 5,027 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 39 WA * 7 |
ソースコード
n,m,p=map(int,input().split())
a=list(map(int,input().split()))
for i in range(n):
if a[i]>m:
print(1)
exit()
while a[i]%p==0:a[i]//=p
ma=max(a)
if ma==1:
print(-1)
exit()
now=1
ans=0
while now<=m:
now*=ma
ans+=1
print(ans)
persimmon_t01