https://www.acmicpc.net/problem/1182
import sys
input = sys.stdin.readline
n, r = map(int, input().split())
arr = list(map(int, input().split()))
cnt = 0
ans = []
def sol(s):
global cnt
if sum(ans) == r and len(ans) > 0:
cnt += 1
for i in range(s, n):
ans.append(arr[i])
sol(i+1)
ans.pop()
sol(0)
print(cnt)
백트래킹 문제..........
15649번 문제와 매우 유사하다