結果

問題 No.2329 Nafmo、イカサマをする
ユーザー redoCtAredoCtA
提出日時 2023-05-28 15:33:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 516 bytes
コンパイル時間 363 ms
コンパイル使用メモリ 10,904 KB
実行使用メモリ 25,928 KB
最終ジャッジ日時 2023-08-27 12:24:33
合計ジャッジ時間 4,069 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,956 KB
testcase_01 AC 16 ms
8,036 KB
testcase_02 AC 17 ms
7,920 KB
testcase_03 WA -
testcase_04 AC 17 ms
8,036 KB
testcase_05 AC 16 ms
7,936 KB
testcase_06 AC 16 ms
8,124 KB
testcase_07 AC 16 ms
8,020 KB
testcase_08 AC 17 ms
8,304 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 16 ms
8,120 KB
testcase_17 WA -
testcase_18 AC 19 ms
8,920 KB
testcase_19 WA -
testcase_20 AC 23 ms
9,184 KB
testcase_21 AC 43 ms
12,456 KB
testcase_22 AC 18 ms
8,428 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 24 ms
9,248 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 16 ms
7,992 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 82 ms
16,864 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 206 ms
25,612 KB
testcase_42 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect
def main():
    N, M, K = map(int, input().split())
    *A, = map(int, input().split())
    A.sort()
    if A[0] > 0:
        A = [0]+A
        N += 1
    S = set()
    for i in range(N):
        for j in range(i, N):
            for k in range(j, N):
                S.add(A[i]+A[j]+A[k])
    L = sorted(list(S))
    ans = 0
    for l in L:
        if l > M:
            break
        p = bisect(L, M-l)
        ans = max(ans, l+L[p-1])
    print(ans)
if __name__ == "__main__":
    main()
0