結果

問題 No.1330 Multiply or Divide
ユーザー brthyyjpbrthyyjp
提出日時 2022-02-03 15:09:45
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 347 bytes
コンパイル時間 552 ms
コンパイル使用メモリ 87,048 KB
実行使用メモリ 118,340 KB
最終ジャッジ日時 2023-09-02 03:18:11
合計ジャッジ時間 8,884 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 144 ms
108,260 KB
testcase_02 WA -
testcase_03 AC 67 ms
71,400 KB
testcase_04 AC 68 ms
71,580 KB
testcase_05 AC 69 ms
71,472 KB
testcase_06 AC 115 ms
118,156 KB
testcase_07 WA -
testcase_08 AC 170 ms
115,540 KB
testcase_09 AC 173 ms
115,616 KB
testcase_10 AC 172 ms
115,256 KB
testcase_11 AC 169 ms
115,320 KB
testcase_12 AC 171 ms
115,672 KB
testcase_13 AC 69 ms
71,432 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 67 ms
71,428 KB
testcase_17 WA -
testcase_18 AC 119 ms
100,740 KB
testcase_19 AC 119 ms
100,720 KB
testcase_20 AC 118 ms
100,716 KB
testcase_21 AC 118 ms
100,648 KB
testcase_22 AC 117 ms
100,548 KB
testcase_23 AC 129 ms
113,640 KB
testcase_24 AC 68 ms
71,236 KB
testcase_25 AC 69 ms
71,100 KB
testcase_26 AC 69 ms
71,240 KB
testcase_27 AC 69 ms
71,116 KB
testcase_28 AC 70 ms
71,544 KB
testcase_29 AC 68 ms
71,364 KB
testcase_30 AC 68 ms
71,244 KB
testcase_31 AC 68 ms
71,344 KB
testcase_32 AC 68 ms
71,364 KB
testcase_33 AC 70 ms
71,328 KB
testcase_34 AC 105 ms
100,944 KB
testcase_35 AC 85 ms
80,940 KB
testcase_36 AC 104 ms
97,816 KB
testcase_37 AC 102 ms
95,180 KB
testcase_38 AC 91 ms
86,948 KB
testcase_39 AC 85 ms
82,124 KB
testcase_40 AC 88 ms
84,416 KB
testcase_41 AC 80 ms
78,852 KB
testcase_42 AC 93 ms
92,828 KB
testcase_43 AC 94 ms
95,344 KB
testcase_44 WA -
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, p = map(int, input().split())
A = list(map(int, input().split()))

if m == 1:
    print(0)
    exit()

if max(A) > m:
    print(1)
    exit()

B = []
for a in A:
    while a%p == 0:
        a //= p
    B.append(a)
B.sort(reverse=True)

if B[0] == 1:
    print(-1)
    exit()

x = 1
ans =0
while x <= m:
    ans += 1
    x *= B[0]
print(ans)
0