結果

問題 No.617 Nafmo、買い出しに行く
ユーザー 💕💖💞💕💖💞
提出日時 2018-06-18 02:58:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,193 ms / 2,000 ms
コード長 377 bytes
コンパイル時間 607 ms
コンパイル使用メモリ 87,204 KB
実行使用メモリ 152,120 KB
最終ジャッジ日時 2023-09-13 06:39:53
合計ジャッジ時間 14,483 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
75,648 KB
testcase_01 AC 66 ms
71,380 KB
testcase_02 AC 108 ms
76,528 KB
testcase_03 AC 157 ms
80,704 KB
testcase_04 AC 67 ms
71,464 KB
testcase_05 AC 224 ms
85,640 KB
testcase_06 AC 1,191 ms
151,644 KB
testcase_07 AC 1,188 ms
151,584 KB
testcase_08 AC 67 ms
71,460 KB
testcase_09 AC 69 ms
71,192 KB
testcase_10 AC 1,190 ms
151,476 KB
testcase_11 AC 1,189 ms
151,800 KB
testcase_12 AC 1,188 ms
152,120 KB
testcase_13 AC 1,190 ms
151,740 KB
testcase_14 AC 1,187 ms
151,712 KB
testcase_15 AC 1,182 ms
151,632 KB
testcase_16 AC 1,193 ms
151,584 KB
testcase_17 AC 1,183 ms
151,508 KB
testcase_18 AC 72 ms
71,136 KB
testcase_19 AC 69 ms
71,428 KB
testcase_20 AC 71 ms
71,392 KB
testcase_21 AC 71 ms
71,140 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)+1):
  #print(i)
  filt = f'{i:020b}'[-1*size:]
  #print(filt)
  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