EISUBSET2 - Subset 2
Xem dạng PDF
Gửi bài giải
Điểm:
1,00 (OI)
Giới hạn thời gian:
1.0s
Giới hạn bộ nhớ:
256M
Input:
stdin
Output:
stdout
Nguồn bài:
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch
Given an array ~A~ of ~n~ integers, count the number of non-empty subsets whose sum is equal to the given integer ~k~
Input
- The first line is ~2~ integers ~n~, ~k~. ~(n \le 20, |k|\le 100)~
- The second line is the ~n~ integers of the array. ~(|A_i| \le 100)~
Output
- Number of subsets that satisfy the requirement
Example Input 1
4 3
-1 1 1 2
Example Output 1
3
Bình luận