Canadian Computing Olympiad: 2023 Day 1, Problem 1
You have been hired by the Cheap Communication Organization (CCO) to work on a communication breakthrough: sub-message sum (SMS). This revolutionary idea works as follows.
Given a binary string of length
For example, if 110010
is
Since you are a very junior developer, your job is not to find the original binary string from a given SMS, but rather the number of binary strings that could have formed this SMS.
Input Specification
The first line of input contains the two space-separated integers
Marks Awarded | Bounds on | Additional Bounds on |
---|---|---|
None | ||
None |
Output Specification
Output the remainder of
Sample Input
7 4
3 2 2 2
Output for Sample Input
3
Explanation of Output for Sample Input
The possible strings of length 1011001
, 1101010
, and 1110011
.
Comments