結果

問題 No.1330 Multiply or Divide
ユーザー ayaoniayaoni
提出日時 2021-01-11 04:50:50
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 787 bytes
コンパイル時間 1,265 ms
コンパイル使用メモリ 86,640 KB
実行使用メモリ 107,528 KB
最終ジャッジ日時 2023-08-13 13:26:34
合計ジャッジ時間 6,914 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 119 ms
107,528 KB
testcase_02 AC 76 ms
71,164 KB
testcase_03 AC 75 ms
71,076 KB
testcase_04 AC 73 ms
71,296 KB
testcase_05 AC 73 ms
71,052 KB
testcase_06 AC 110 ms
104,340 KB
testcase_07 WA -
testcase_08 AC 133 ms
100,380 KB
testcase_09 AC 133 ms
100,320 KB
testcase_10 AC 132 ms
100,188 KB
testcase_11 AC 130 ms
100,252 KB
testcase_12 AC 129 ms
100,576 KB
testcase_13 AC 75 ms
71,156 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 75 ms
71,192 KB
testcase_17 WA -
testcase_18 AC 123 ms
100,600 KB
testcase_19 AC 119 ms
100,300 KB
testcase_20 AC 120 ms
100,108 KB
testcase_21 AC 121 ms
100,272 KB
testcase_22 AC 121 ms
100,324 KB
testcase_23 WA -
testcase_24 AC 76 ms
71,072 KB
testcase_25 AC 73 ms
71,244 KB
testcase_26 WA -
testcase_27 AC 74 ms
71,196 KB
testcase_28 AC 76 ms
71,288 KB
testcase_29 AC 73 ms
71,232 KB
testcase_30 AC 74 ms
71,164 KB
testcase_31 AC 74 ms
71,192 KB
testcase_32 AC 74 ms
70,900 KB
testcase_33 AC 75 ms
71,248 KB
testcase_34 AC 109 ms
100,780 KB
testcase_35 AC 84 ms
80,860 KB
testcase_36 AC 105 ms
97,540 KB
testcase_37 AC 101 ms
95,044 KB
testcase_38 AC 91 ms
86,672 KB
testcase_39 AC 87 ms
81,928 KB
testcase_40 AC 88 ms
84,080 KB
testcase_41 AC 82 ms
78,624 KB
testcase_42 AC 100 ms
92,780 KB
testcase_43 AC 105 ms
95,420 KB
testcase_44 WA -
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())


N,M,P = MI()
A = LI()

max_A = max(A)
ans = 1
X = (M+max_A-1)//max_A

if X == 1:
    print(ans)
    exit()

for i in range(N):
    a = A[i]
    if a % P == 0:
        while a % P == 0:
            a //= P
    A[i] = a

max_A = max(A)

if max_A == 1:
    print(-1)
    exit()

x = 1
while x < X:
    x *= max_A
    ans += 1

print(ans)
0