#P3589. [POI 2015 R2] 快速阅读课程 Speed reading course
[POI 2015 R2] 快速阅读课程 Speed reading course
Description
Given , where and are coprime.
Define a binary string of length , where equals if and only if .
Given a binary string of length , count how many times the small string appears in the big string.
Input Format
The first line contains integers (, , ). It is guaranteed that and are coprime.
The second line contains a binary string of length .
Output Format
Output a single integer, the number of occurrences of the small string in the big string.
9 5 6 4 3
101
3
Hint
Bold Sample Explanation

Original title: Kurs szybkiego czytania.
Translated by ChatGPT 5
京公网安备 11011102002149号