您好,欢迎访问一九零五行业门户网

Codeforces Round #226 (Div. 2)

the bear has a string s ?=? s 1 s 2 ... s | s | (record | s | is the string's length), consisting of lowercase english letters. the bear wants to count the number of such pairs of indices i ,? j (1?≤? i ?≤? j ?≤?| s |) , that string x (
the bear has a string s?=?s1s2... s|s| (record |s| is the string's length), consisting of lowercase english letters. the bear wants to count the number of such pairs of indices i,?j (1?≤?i?≤?j?≤?|s|), that string x(i,?j)?=?sisi?+?1... sj contains at least one string bear as a substring.
string x(i,?j) contains string bear, if there is such index k (i?≤?k?≤?j?-?3), that sk?=?b, sk?+?1?=?e, sk?+?2?=?a, sk?+?3?=?r.
help the bear cope with the given problem.
其它类似信息

推荐信息