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