結果

問題 No.1330 Multiply or Divide
ユーザー hir355hir355
提出日時 2021-01-08 21:46:29
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 389 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 81,716 KB
実行使用メモリ 104,064 KB
最終ジャッジ日時 2024-04-28 05:43:20
合計ジャッジ時間 4,764 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 90 ms
104,064 KB
testcase_02 AC 39 ms
51,456 KB
testcase_03 AC 36 ms
51,840 KB
testcase_04 AC 36 ms
51,712 KB
testcase_05 AC 35 ms
51,840 KB
testcase_06 AC 75 ms
97,024 KB
testcase_07 AC 101 ms
103,936 KB
testcase_08 AC 109 ms
102,016 KB
testcase_09 AC 111 ms
102,044 KB
testcase_10 AC 109 ms
101,888 KB
testcase_11 AC 110 ms
102,016 KB
testcase_12 AC 110 ms
101,888 KB
testcase_13 AC 38 ms
52,352 KB
testcase_14 AC 37 ms
52,224 KB
testcase_15 AC 36 ms
51,584 KB
testcase_16 AC 36 ms
51,968 KB
testcase_17 AC 36 ms
52,096 KB
testcase_18 AC 99 ms
102,144 KB
testcase_19 AC 103 ms
101,888 KB
testcase_20 AC 101 ms
101,632 KB
testcase_21 AC 104 ms
101,840 KB
testcase_22 AC 102 ms
102,016 KB
testcase_23 AC 102 ms
101,888 KB
testcase_24 AC 38 ms
51,712 KB
testcase_25 AC 39 ms
52,352 KB
testcase_26 AC 38 ms
52,352 KB
testcase_27 AC 37 ms
51,840 KB
testcase_28 AC 37 ms
52,096 KB
testcase_29 AC 37 ms
51,712 KB
testcase_30 AC 37 ms
52,224 KB
testcase_31 AC 37 ms
51,840 KB
testcase_32 AC 36 ms
52,224 KB
testcase_33 AC 36 ms
51,840 KB
testcase_34 AC 82 ms
98,048 KB
testcase_35 AC 54 ms
70,272 KB
testcase_36 AC 79 ms
93,696 KB
testcase_37 AC 75 ms
89,472 KB
testcase_38 AC 63 ms
78,080 KB
testcase_39 AC 57 ms
70,784 KB
testcase_40 AC 60 ms
75,520 KB
testcase_41 AC 53 ms
67,584 KB
testcase_42 AC 72 ms
86,784 KB
testcase_43 AC 77 ms
91,008 KB
testcase_44 AC 89 ms
97,536 KB
testcase_45 AC 95 ms
97,792 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