結果
| 問題 | No.1330 Multiply or Divide |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-02-24 22:14:26 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 326 bytes |
| 記録 | |
| コンパイル時間 | 152 ms |
| コンパイル使用メモリ | 85,376 KB |
| 実行使用メモリ | 111,360 KB |
| 最終ジャッジ日時 | 2026-03-23 22:01:55 |
| 合計ジャッジ時間 | 4,631 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 40 WA * 11 |
ソースコード
n, m, p = map(int, input().split())
A = list(map(int, input().split()))
ma_ = max(A)
if ma_ > m:
print(1)
exit()
for i in range(n):
while A[i] % p == 0:
A[i] //= p
ma = max(A)
if ma == 1:
print(-1)
else:
cnt = 0
x = 1
while x * ma_ <= m:
x *= ma
cnt += 1
print(cnt + 1)