結果

問題 No.1330 Multiply or Divide
ユーザー convexineqconvexineq
提出日時 2021-01-09 20:19:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 707 ms / 2,000 ms
コード長 294 bytes
コンパイル時間 188 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 117,052 KB
最終ジャッジ日時 2024-04-29 08:56:09
合計ジャッジ時間 5,601 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,096 KB
testcase_01 AC 95 ms
111,168 KB
testcase_02 AC 41 ms
51,968 KB
testcase_03 AC 37 ms
51,712 KB
testcase_04 AC 43 ms
59,264 KB
testcase_05 AC 37 ms
52,224 KB
testcase_06 AC 707 ms
107,904 KB
testcase_07 AC 241 ms
111,104 KB
testcase_08 AC 112 ms
117,052 KB
testcase_09 AC 112 ms
116,732 KB
testcase_10 AC 112 ms
116,864 KB
testcase_11 AC 109 ms
116,864 KB
testcase_12 AC 111 ms
116,676 KB
testcase_13 AC 37 ms
52,224 KB
testcase_14 AC 38 ms
52,096 KB
testcase_15 AC 37 ms
52,096 KB
testcase_16 AC 38 ms
51,968 KB
testcase_17 AC 38 ms
51,968 KB
testcase_18 AC 95 ms
113,024 KB
testcase_19 AC 96 ms
113,152 KB
testcase_20 AC 95 ms
113,152 KB
testcase_21 AC 96 ms
112,896 KB
testcase_22 AC 95 ms
112,640 KB
testcase_23 AC 98 ms
115,072 KB
testcase_24 AC 37 ms
51,584 KB
testcase_25 AC 36 ms
51,840 KB
testcase_26 AC 36 ms
51,968 KB
testcase_27 AC 37 ms
51,840 KB
testcase_28 AC 37 ms
51,840 KB
testcase_29 AC 37 ms
51,840 KB
testcase_30 AC 37 ms
52,224 KB
testcase_31 AC 36 ms
52,352 KB
testcase_32 AC 37 ms
51,840 KB
testcase_33 AC 37 ms
51,968 KB
testcase_34 AC 82 ms
100,608 KB
testcase_35 AC 51 ms
70,016 KB
testcase_36 AC 76 ms
95,872 KB
testcase_37 AC 72 ms
91,520 KB
testcase_38 AC 60 ms
79,360 KB
testcase_39 AC 53 ms
72,064 KB
testcase_40 AC 57 ms
75,648 KB
testcase_41 AC 48 ms
67,200 KB
testcase_42 AC 69 ms
88,448 KB
testcase_43 AC 74 ms
92,416 KB
testcase_44 AC 118 ms
106,624 KB
testcase_45 AC 124 ms
107,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,p,*a = map(int,open(0).read().split())
t = [1]*n
m //= max(a)
for i in range(n):
    while a[i]%p==0:
        a[i] //= p
        t[i] += 1
dp = [1]*1024
for i in range(999):
    if dp[i] > m: break
    for ai,ti in zip(a,t):
        dp[i+ti] = max(dp[i+ti],dp[i]*ai)
else: i = -2
print(i+1)
0