結果

問題 No.2329 Nafmo、イカサマをする
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2023-05-28 14:51:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 154 ms / 2,000 ms
コード長 550 bytes
コンパイル時間 370 ms
コンパイル使用メモリ 86,928 KB
実行使用メモリ 99,444 KB
最終ジャッジ日時 2023-08-27 10:43:13
合計ジャッジ時間 5,465 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,264 KB
testcase_01 AC 74 ms
71,264 KB
testcase_02 AC 74 ms
70,840 KB
testcase_03 AC 73 ms
71,316 KB
testcase_04 AC 74 ms
71,112 KB
testcase_05 AC 72 ms
71,156 KB
testcase_06 AC 74 ms
71,196 KB
testcase_07 AC 76 ms
71,264 KB
testcase_08 AC 85 ms
75,704 KB
testcase_09 AC 75 ms
71,036 KB
testcase_10 AC 74 ms
71,148 KB
testcase_11 AC 75 ms
71,332 KB
testcase_12 AC 75 ms
71,328 KB
testcase_13 AC 76 ms
70,884 KB
testcase_14 AC 76 ms
71,272 KB
testcase_15 AC 74 ms
71,228 KB
testcase_16 AC 74 ms
71,268 KB
testcase_17 AC 73 ms
70,964 KB
testcase_18 AC 74 ms
71,240 KB
testcase_19 AC 83 ms
75,780 KB
testcase_20 AC 78 ms
75,344 KB
testcase_21 AC 77 ms
75,232 KB
testcase_22 AC 80 ms
75,408 KB
testcase_23 AC 75 ms
70,884 KB
testcase_24 AC 74 ms
71,072 KB
testcase_25 AC 76 ms
75,292 KB
testcase_26 AC 75 ms
71,076 KB
testcase_27 AC 75 ms
70,884 KB
testcase_28 AC 73 ms
71,180 KB
testcase_29 AC 90 ms
76,316 KB
testcase_30 AC 77 ms
75,236 KB
testcase_31 AC 74 ms
71,176 KB
testcase_32 AC 74 ms
71,264 KB
testcase_33 AC 74 ms
71,080 KB
testcase_34 AC 75 ms
71,148 KB
testcase_35 AC 80 ms
75,308 KB
testcase_36 AC 95 ms
76,780 KB
testcase_37 AC 77 ms
75,440 KB
testcase_38 AC 75 ms
71,036 KB
testcase_39 AC 93 ms
77,760 KB
testcase_40 AC 86 ms
75,876 KB
testcase_41 AC 154 ms
99,444 KB
testcase_42 AC 86 ms
75,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

l = k//2
r = k-l

dp = [0]

def get(l):
    temp = set([0])
    for i in range(l):
        ntemp = set()
        for x in temp:
            ntemp.add(x)
            for a in A:
                if a+x <= m:
                    ntemp.add(a+x)
        temp = ntemp

    return sorted(temp)


llist = get(l)
rlist = get(r)

ans = 0
r = len(rlist)-1

for x in llist:
    while r >= 0 and rlist[r]+x > m:
        r -= 1
    
    if r != -1:
        ans = max(ans,x+rlist[r])
print(ans)

0