QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 1024 MB Total points: 100

#10352. Zliczanie ciągów

Statistics

Dany jest ciąg $\{a_0, a_1, \cdots, a_{n - 1}\}$ składający się wyłącznie z zer i jedynek. Oblicz, ile istnieje ciągów $\{b_0, b_1, \cdots, b_{m - 1}\}$ o długości od $1$ do $n$, składających się wyłącznie z zer i jedynek, takich że dla każdego $0 \le p \le n - m$ suma $\sum_{k = 0} ^ {m - 1}{a_{p + k} \wedge b_k}$ jest parzysta.

Wynik podaj modulo $1\,000\,000\,007$.

Wejście

W jednym wierszu znajduje się ciąg znaków złożony z zer i jedynek, reprezentujący ciąg $a$, gdzie $k$-ty znak od lewej odpowiada $a_k$.

Wyjście

W jednym wierszu wypisz liczbę ciągów $b$ modulo $1\,000\,000\,007$.

Przykład

Wejście 1

00101110101110101011

Wyjście 1

699063

Wejście 2

00001100100101110011110011100010011010101011001010

Wyjście 2

932640914

Ograniczenia

Ograniczenia dla każdej grupy testów przedstawiono poniżej:

Numer testu $n$
1$n \le 20$
2
3$n \le 100$
4
5
6
7$n \le 5000$
8
9
10
11
12
13$n \le 50000$
14
15
16
17
18
19
20

Dla wszystkich danych wejściowych $1 \le n \le 50000$, a ciąg wejściowy składa się wyłącznie z zer i jedynek.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.