結果

問題 No.1330 Multiply or Divide
ユーザー hir355hir355
提出日時 2021-01-08 21:46:29
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 389 bytes
コンパイル時間 1,192 ms
コンパイル使用メモリ 86,972 KB
実行使用メモリ 108,356 KB
最終ジャッジ日時 2023-08-10 12:26:26
合計ジャッジ時間 6,938 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 118 ms
108,356 KB
testcase_02 AC 71 ms
71,092 KB
testcase_03 AC 69 ms
71,304 KB
testcase_04 AC 69 ms
71,316 KB
testcase_05 AC 69 ms
71,276 KB
testcase_06 AC 105 ms
104,304 KB
testcase_07 AC 131 ms
107,740 KB
testcase_08 AC 136 ms
100,352 KB
testcase_09 AC 136 ms
100,296 KB
testcase_10 AC 137 ms
100,344 KB
testcase_11 AC 133 ms
100,336 KB
testcase_12 AC 135 ms
100,560 KB
testcase_13 AC 71 ms
71,028 KB
testcase_14 AC 69 ms
71,028 KB
testcase_15 AC 68 ms
71,328 KB
testcase_16 AC 68 ms
71,268 KB
testcase_17 AC 68 ms
71,320 KB
testcase_18 AC 126 ms
100,388 KB
testcase_19 AC 130 ms
100,356 KB
testcase_20 AC 129 ms
100,504 KB
testcase_21 AC 127 ms
100,520 KB
testcase_22 AC 128 ms
100,344 KB
testcase_23 AC 126 ms
99,728 KB
testcase_24 AC 70 ms
71,260 KB
testcase_25 AC 70 ms
71,348 KB
testcase_26 AC 70 ms
71,148 KB
testcase_27 AC 69 ms
71,140 KB
testcase_28 AC 69 ms
71,344 KB
testcase_29 AC 70 ms
71,400 KB
testcase_30 AC 69 ms
71,308 KB
testcase_31 AC 71 ms
71,396 KB
testcase_32 AC 70 ms
71,088 KB
testcase_33 AC 68 ms
71,372 KB
testcase_34 AC 112 ms
101,828 KB
testcase_35 AC 85 ms
81,484 KB
testcase_36 AC 106 ms
98,364 KB
testcase_37 AC 102 ms
95,756 KB
testcase_38 AC 93 ms
87,508 KB
testcase_39 AC 84 ms
82,472 KB
testcase_40 AC 90 ms
84,944 KB
testcase_41 AC 84 ms
79,208 KB
testcase_42 AC 101 ms
93,464 KB
testcase_43 AC 104 ms
96,024 KB
testcase_44 AC 117 ms
104,392 KB
testcase_45 AC 121 ms
104,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, p = map(int, input().split())
a = list(map(int, input().split()))
ans = 10 ** 9
s = set()
t = 1
for k in a:
    tmp = k
    t = 1
    while k % p == 0:
        k //= p
        t += 1
    if k == 1 and tmp <= m:
        continue
    x = 1
    res = 1
    while x * tmp <= m:
        x *= k
        res += t
    ans = min(ans, res)
if ans != 10 ** 9:
    print(ans)
else:
    print(-1)
0