結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 135 ms
30,824 KB
testcase_02 AC 31 ms
10,880 KB
testcase_03 AC 29 ms
10,752 KB
testcase_04 AC 29 ms
10,880 KB
testcase_05 AC 27 ms
10,752 KB
testcase_06 AC 112 ms
14,608 KB
testcase_07 WA -
testcase_08 AC 141 ms
32,652 KB
testcase_09 AC 151 ms
32,640 KB
testcase_10 AC 143 ms
32,596 KB
testcase_11 AC 138 ms
32,648 KB
testcase_12 AC 143 ms
32,768 KB
testcase_13 AC 31 ms
11,008 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 30 ms
10,752 KB
testcase_17 WA -
testcase_18 AC 134 ms
32,512 KB
testcase_19 AC 135 ms
32,640 KB
testcase_20 AC 135 ms
32,676 KB
testcase_21 AC 135 ms
32,516 KB
testcase_22 AC 136 ms
32,648 KB
testcase_23 AC 126 ms
32,676 KB
testcase_24 AC 27 ms
10,752 KB
testcase_25 AC 27 ms
10,752 KB
testcase_26 AC 26 ms
10,880 KB
testcase_27 AC 27 ms
10,880 KB
testcase_28 AC 27 ms
10,880 KB
testcase_29 AC 26 ms
10,752 KB
testcase_30 AC 26 ms
10,752 KB
testcase_31 AC 27 ms
10,752 KB
testcase_32 AC 26 ms
11,008 KB
testcase_33 AC 28 ms
10,752 KB
testcase_34 AC 106 ms
26,880 KB
testcase_35 AC 51 ms
15,288 KB
testcase_36 AC 99 ms
25,156 KB
testcase_37 AC 91 ms
23,644 KB
testcase_38 AC 68 ms
18,612 KB
testcase_39 AC 57 ms
16,240 KB
testcase_40 AC 63 ms
17,356 KB
testcase_41 AC 47 ms
13,968 KB
testcase_42 AC 86 ms
22,640 KB
testcase_43 AC 96 ms
24,500 KB
testcase_44 WA -
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(x):
    while 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 in [0, 1]:
    print(-1)
    exit()

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