結果

問題 No.2329 Nafmo、イカサマをする
ユーザー とりゐとりゐ
提出日時 2023-05-28 14:19:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 153 ms / 2,000 ms
コード長 412 bytes
コンパイル時間 1,485 ms
コンパイル使用メモリ 86,556 KB
実行使用メモリ 99,268 KB
最終ジャッジ日時 2023-08-27 09:30:22
合計ジャッジ時間 5,480 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,232 KB
testcase_01 AC 76 ms
71,388 KB
testcase_02 AC 75 ms
71,316 KB
testcase_03 AC 78 ms
71,316 KB
testcase_04 AC 75 ms
71,376 KB
testcase_05 AC 74 ms
71,332 KB
testcase_06 AC 75 ms
71,200 KB
testcase_07 AC 75 ms
71,208 KB
testcase_08 AC 84 ms
76,016 KB
testcase_09 AC 75 ms
71,200 KB
testcase_10 AC 76 ms
71,348 KB
testcase_11 AC 77 ms
70,992 KB
testcase_12 AC 75 ms
71,352 KB
testcase_13 AC 77 ms
71,160 KB
testcase_14 AC 77 ms
71,076 KB
testcase_15 AC 76 ms
71,196 KB
testcase_16 AC 78 ms
71,396 KB
testcase_17 AC 79 ms
71,312 KB
testcase_18 AC 76 ms
71,316 KB
testcase_19 AC 89 ms
75,840 KB
testcase_20 AC 81 ms
75,292 KB
testcase_21 AC 81 ms
75,076 KB
testcase_22 AC 83 ms
75,824 KB
testcase_23 AC 78 ms
71,184 KB
testcase_24 AC 76 ms
71,352 KB
testcase_25 AC 81 ms
75,636 KB
testcase_26 AC 77 ms
71,176 KB
testcase_27 AC 77 ms
70,956 KB
testcase_28 AC 77 ms
71,160 KB
testcase_29 AC 91 ms
75,952 KB
testcase_30 AC 78 ms
75,260 KB
testcase_31 AC 77 ms
71,144 KB
testcase_32 AC 77 ms
71,408 KB
testcase_33 AC 77 ms
71,180 KB
testcase_34 AC 77 ms
71,164 KB
testcase_35 AC 82 ms
75,404 KB
testcase_36 AC 96 ms
77,000 KB
testcase_37 AC 81 ms
75,664 KB
testcase_38 AC 78 ms
71,076 KB
testcase_39 AC 96 ms
77,800 KB
testcase_40 AC 90 ms
75,904 KB
testcase_41 AC 153 ms
99,268 KB
testcase_42 AC 92 ms
75,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,k=map(int,input().split())
a=list(map(int,input().split()))

k1=k//2
k2=k-k1

def get(s):
  if s==0:
    return [0]
  res=get(s-1)
  new=set(res)
  for i in range(n):
    for j in res:
      if a[i]+j<=m:
        new.add(a[i]+j)
  return list(new)

res1=get(k1)
res2=get(k2)
res1.sort()
res2.sort()
ans=0
idx=len(res2)-1
for i in res1:
  while i+res2[idx]>m:
    idx-=1
  ans=max(ans,i+res2[idx])

print(ans)
0