結果
問題 | No.617 Nafmo、買い出しに行く |
ユーザー | _KingdomOfMoray |
提出日時 | 2020-01-03 08:49:36 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 323 bytes |
コンパイル時間 | 246 ms |
コンパイル使用メモリ | 10,724 KB |
実行使用メモリ | 42,116 KB |
最終ジャッジ日時 | 2023-08-14 19:04:22 |
合計ジャッジ時間 | 4,542 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 15 ms
7,996 KB |
testcase_01 | AC | 15 ms
7,824 KB |
testcase_02 | AC | 20 ms
7,824 KB |
testcase_03 | AC | 225 ms
11,296 KB |
testcase_04 | AC | 14 ms
7,808 KB |
testcase_05 | AC | 447 ms
14,288 KB |
testcase_06 | TLE | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
ソースコード
input_list = list(map(int,input().split())) n, k = input_list a_list = [int(input()) for i in range(n)] res_list = [] for i in range(2 ** n): res_e = 0 for j in range(n): if (i >> j) & 1: res_e += a_list[j] res_list.append(res_e) res = max([e for e in res_list if e <= k]) print(res)