Logo
(追記) (追記ここまで)

28317번 - Binaria 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB98413960.000%

문제

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 $N,ドル and some positive integer $K$ with $K \le N,ドル the SMS for the string consists of a sequence of $N - K + 1$ sums. The first sum in the sequence is the sum of digits 1ドル$ through $K,ドル the second sum is the sum of digits 2ドル$ through $K + 1,ドル and so on until the last sum which is the sum of digits $N - K + 1$ through $N$.

For example, if $K = 4,ドル the SMS of the binary string 110010 is 2,2,1ドル$. This is because 1ドル + 1 + 0 + 0 = 2, 1 +たす 0 +たす 0 +たす 1 = 2,$ and 0ドル + 0 + 1 + 0 = 1$.

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.

입력

The first line of input contains the two space-separated integers $N$ and $K$ where 1ドル \le K \le N$. The second line of input contains $N - K + 1$ space-separated integers which is the SMS of at least one binary string.

출력

Output the remainder of $T$ divided by the prime number 10ドル^{6} + 3$ where $T$ is the positive integer equal to the total number of possible binary strings that correspond to the given SMS.

제한

  • 1ドル \le N \le 10^6$

예제 입력 1

7 4
3 2 2 2

예제 출력 1

3

The possible strings of length 7ドル$ are 1011001, 1101010, and 1110011.

힌트

출처

Olympiad > Canadian Computing Competition & Olympiad > 2023 > CCO 2023 1번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /