結果

問題 No.617 Nafmo、買い出しに行く
ユーザー 💕💖💞💕💖💞
提出日時 2018-06-18 02:56:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 360 bytes
コンパイル時間 76 ms
コンパイル使用メモリ 10,852 KB
実行使用メモリ 49,440 KB
最終ジャッジ日時 2023-09-13 06:38:20
合計ジャッジ時間 27,518 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,844 KB
testcase_01 AC 15 ms
7,836 KB
testcase_02 AC 20 ms
7,804 KB
testcase_03 AC 168 ms
10,820 KB
testcase_04 AC 16 ms
7,860 KB
testcase_05 WA -
testcase_06 TLE -
testcase_07 TLE -
testcase_08 AC 16 ms
7,844 KB
testcase_09 AC 15 ms
7,800 KB
testcase_10 TLE -
testcase_11 TLE -
testcase_12 TLE -
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 AC 16 ms
7,968 KB
testcase_19 WA -
testcase_20 AC 16 ms
7,824 KB
testcase_21 AC 16 ms
7,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split(' '))

xs = []
for i in range(n):
  xs.append( int( input() ) )

fullbin = f'1'*len(xs)
#print(fullbin)

ss = []
size = len(fullbin)
for i in range(0,int(fullbin,2)):
  #print(i)
  filt = f'{i:020b}'[-1*size:]
  s = sum( [ x for f, x in zip(filt, xs) if f == '1' ] )
  ss.append( s )

m = max(filter(lambda x:x <= k, ss))
print(m)
0