백트래킹 풀이
void solve(int tot, int cnt){
if(cnt==n) {
if(tot==s) answer++;
return;
}
solve(tot,cnt+1);
solve(tot+arr[cnt],cnt+1);
}
int main()
{
cin>>n>>s;
for(int i=0;i<n;i++){
cin>>arr[i];
}
solve(0,0);
if(s==0)answer-=1;
cout<<answer;
}