练82.3 选数
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Description
Given integers , , ..., , and an integer (). From these integers, choose any integers and add them together to get a series of sums. For example, when , , and the integers are , , , , all possible combinations and their sums are:
Now, you need to calculate how many of these sums are prime numbers.
In the example above, only one sum is prime: .
Input Format
The first line contains and (, ).
The second line contains numbers:
... (), separated by spaces.
Output Format
A single integer representing the number of combinations that sum to a prime number.
Sample
4 3
3 7 12 191
20251025D班作业(4)
- Status
- Done
- Problem
- 12
- Open Since
- 2025-10-26 0:00
- Deadline
- 2025-11-3 23:59
- Extension
- 24 hour(s)