report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
String occurences 2 - MarisaOJ: Marisa Online Judge

String occurences 2

Time limit: 1000 ms
Memory limit: 256 MB
You are given 2 string $S$ and $T$. Count the number of occurrences of $T$ in $S$ (i.e. how many substrings of $S$ equal to $T$). ### Input - First line contains string $S$. - Second line contains string $C$. ### Output - The number of occurrences of $T$ in $S$. ### Constraints - $1 \le |T| \le |S| \le 10^6$. ### Example Input: ``` asasa asa ``` Output: ``` 2 ```
String matching - Hash
String occurences 2
Repeated string
Compare substring
Palindrome substring 2
String combinations
Frequent substring
Good pairs
String rotation
Bit reversing
Repeated string 2
Topic
String
Hashing
Rating 1000
Solution (1) Solution