# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
448470 | fuad27 | Ice Hockey World Championship (CEOI15_bobek) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
n, m = map(int, input().split())
arr = [int(i) for i in input().split()]
c = 0
for b in range(1<<n):
s = 0
for i in range(n):
if b&(1<<i): s+=arr[i]
if s > m: break
if s <= m:c+=1
print(c)