結果

問題 No.1330 Multiply or Divide
ユーザー 👑 rin204rin204
提出日時 2022-02-24 22:14:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 326 bytes
コンパイル時間 323 ms
コンパイル使用メモリ 87,080 KB
実行使用メモリ 107,804 KB
最終ジャッジ日時 2023-09-15 10:13:34
合計ジャッジ時間 8,232 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 112 ms
107,804 KB
testcase_02 AC 76 ms
71,448 KB
testcase_03 AC 73 ms
71,300 KB
testcase_04 AC 70 ms
71,224 KB
testcase_05 AC 73 ms
71,076 KB
testcase_06 AC 105 ms
104,744 KB
testcase_07 WA -
testcase_08 AC 131 ms
100,500 KB
testcase_09 AC 139 ms
100,420 KB
testcase_10 AC 137 ms
100,568 KB
testcase_11 AC 135 ms
100,648 KB
testcase_12 AC 136 ms
100,416 KB
testcase_13 AC 75 ms
71,228 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 71 ms
71,244 KB
testcase_17 WA -
testcase_18 AC 123 ms
100,504 KB
testcase_19 AC 125 ms
100,460 KB
testcase_20 AC 122 ms
100,252 KB
testcase_21 AC 122 ms
100,444 KB
testcase_22 AC 123 ms
100,572 KB
testcase_23 AC 125 ms
99,980 KB
testcase_24 AC 71 ms
71,292 KB
testcase_25 AC 69 ms
70,960 KB
testcase_26 AC 72 ms
71,252 KB
testcase_27 AC 69 ms
71,184 KB
testcase_28 AC 72 ms
71,248 KB
testcase_29 AC 70 ms
71,308 KB
testcase_30 AC 71 ms
71,252 KB
testcase_31 AC 69 ms
71,224 KB
testcase_32 AC 72 ms
71,084 KB
testcase_33 AC 71 ms
71,256 KB
testcase_34 AC 106 ms
100,928 KB
testcase_35 AC 82 ms
80,932 KB
testcase_36 AC 104 ms
97,724 KB
testcase_37 AC 96 ms
95,024 KB
testcase_38 AC 90 ms
86,852 KB
testcase_39 AC 87 ms
82,008 KB
testcase_40 AC 90 ms
84,316 KB
testcase_41 AC 85 ms
78,888 KB
testcase_42 AC 101 ms
92,776 KB
testcase_43 AC 104 ms
95,376 KB
testcase_44 WA -
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, p = map(int, input().split())
A = list(map(int, input().split()))
ma_ = max(A)
if ma_ > m:
    print(1)
    exit()
for i in range(n):
    while A[i] % p == 0:
        A[i] //= p

ma = max(A)
if ma == 1:
    print(-1)
else:
    cnt = 0
    x = 1
    while x * ma_ <= m:
        x *= ma
        cnt += 1
    print(cnt + 1)
0