QOJ.ac

QOJ

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

#10352. 序列计数

الإحصائيات

给定一个仅由 0 和 1 组成的数列$ \{a_0, a_1, \cdots, a_{n - 1}\}$。求有多少个仅有0和1组成的长度在 $1$ 到 $n$ 之间的数列 $\{b_0, b_1, \cdots, b_{m - 1}\}$,使得对于任意 $0 \le p \le n - m$,$\sum_{k = 0} ^ {m - 1}{a_{p + k} \wedge b_k}$均为偶数。

答案对 $1\,000\,000\,007$ 取模。

输入格式

一行一个 01 串,表示数列 $a$,从左到右的第 $k$ 个字符表示 $a_k$。

输出格式

一行一个整数表示数列 $b$ 的个数对 $1\,000\,000\,007$ 取模的值。

样例一

input

00101110101110101011

output

699063

样例二

input

00001100100101110011110011100010011010101011001010

output

932640914

限制与约定

每组测试数据的限制与约定如下所示:

测试点编号 $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

对于全部数据$1 \le n \le 50000$,输入数据中的串是一个01串。

About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.