結果

問題 No.1330 Multiply or Divide
ユーザー 👑 KazunKazun
提出日時 2021-01-08 22:30:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 416 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 157,440 KB
最終ジャッジ日時 2024-04-28 03:56:10
合計ジャッジ時間 6,306 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 192 ms
157,440 KB
testcase_02 WA -
testcase_03 AC 38 ms
52,096 KB
testcase_04 WA -
testcase_05 AC 40 ms
51,968 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 193 ms
151,384 KB
testcase_09 AC 201 ms
151,272 KB
testcase_10 AC 192 ms
151,148 KB
testcase_11 AC 191 ms
151,436 KB
testcase_12 AC 190 ms
151,068 KB
testcase_13 AC 41 ms
51,840 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 39 ms
51,712 KB
testcase_17 WA -
testcase_18 AC 177 ms
151,200 KB
testcase_19 AC 179 ms
151,196 KB
testcase_20 AC 191 ms
150,948 KB
testcase_21 AC 195 ms
151,196 KB
testcase_22 AC 199 ms
151,032 KB
testcase_23 AC 101 ms
99,972 KB
testcase_24 AC 41 ms
51,840 KB
testcase_25 AC 41 ms
51,968 KB
testcase_26 AC 41 ms
51,968 KB
testcase_27 AC 41 ms
51,712 KB
testcase_28 AC 41 ms
52,224 KB
testcase_29 AC 41 ms
51,840 KB
testcase_30 AC 41 ms
51,840 KB
testcase_31 AC 42 ms
51,840 KB
testcase_32 AC 42 ms
51,712 KB
testcase_33 AC 42 ms
52,352 KB
testcase_34 AC 151 ms
135,680 KB
testcase_35 AC 76 ms
80,256 KB
testcase_36 AC 139 ms
127,232 KB
testcase_37 AC 122 ms
120,048 KB
testcase_38 AC 92 ms
98,176 KB
testcase_39 AC 74 ms
85,376 KB
testcase_40 AC 90 ms
91,264 KB
testcase_41 AC 63 ms
74,240 KB
testcase_42 AC 111 ms
114,096 KB
testcase_43 AC 119 ms
121,088 KB
testcase_44 WA -
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=sys.stdin.readline

N,M,P=map(int,input().split())
A=set(map(int,input().split()))
A=list(A)

Max=max(A)

T={}
for b in A:
    a=b
    m=1
    while b%P==0:
        b//=P

    if b>1 and (b not in T or T[b]>m):
        T[b]=m

if not T and M<=Max:
    print(-1)
    exit(0)

X=float("inf")
for b in T:
    m=T[b]
    k=1
    x=1
    while x*Max<=M:
        x*=b
        k+=m
    X=min(X,k)
print(X)
0