結果

問題 No.1330 Multiply or Divide
ユーザー c-yanc-yan
提出日時 2021-01-08 22:33:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 324 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 32,648 KB
最終ジャッジ日時 2024-04-28 03:59:49
合計ジャッジ時間 5,444 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 133 ms
30,952 KB
testcase_02 AC 30 ms
10,624 KB
testcase_03 AC 30 ms
10,624 KB
testcase_04 WA -
testcase_05 AC 31 ms
10,624 KB
testcase_06 AC 107 ms
14,616 KB
testcase_07 WA -
testcase_08 AC 139 ms
32,648 KB
testcase_09 AC 144 ms
32,520 KB
testcase_10 AC 138 ms
32,644 KB
testcase_11 AC 137 ms
32,644 KB
testcase_12 AC 137 ms
32,388 KB
testcase_13 AC 31 ms
10,752 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 30 ms
10,624 KB
testcase_17 WA -
testcase_18 AC 138 ms
32,520 KB
testcase_19 AC 135 ms
32,640 KB
testcase_20 AC 137 ms
32,516 KB
testcase_21 AC 138 ms
32,648 KB
testcase_22 AC 136 ms
32,520 KB
testcase_23 AC 132 ms
32,628 KB
testcase_24 AC 31 ms
10,752 KB
testcase_25 AC 31 ms
10,624 KB
testcase_26 AC 31 ms
10,752 KB
testcase_27 AC 32 ms
10,624 KB
testcase_28 AC 33 ms
10,752 KB
testcase_29 AC 31 ms
10,880 KB
testcase_30 AC 31 ms
10,752 KB
testcase_31 AC 31 ms
10,624 KB
testcase_32 AC 30 ms
10,624 KB
testcase_33 AC 30 ms
10,752 KB
testcase_34 AC 108 ms
26,876 KB
testcase_35 AC 52 ms
15,164 KB
testcase_36 AC 100 ms
25,160 KB
testcase_37 AC 94 ms
23,392 KB
testcase_38 AC 70 ms
18,612 KB
testcase_39 AC 59 ms
16,364 KB
testcase_40 AC 65 ms
17,224 KB
testcase_41 AC 48 ms
14,088 KB
testcase_42 AC 88 ms
22,512 KB
testcase_43 AC 97 ms
24,240 KB
testcase_44 WA -
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(x):
    if x % P == 0:
        x //= P
    return x

N, M, P, *A = map(int, open(0).read().split())

max_A = max(A)
t = max(map(f, A))

if max_A > M:
    print(1)
    exit()

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

x = 1
result = 0
while True:
    result += 1
    if x * max_A > M:
        break
    x *= t
print(result)
0