Codeforces Round #226 (Div. 2)
程序员文章站
2023-12-25 17:28:15
...
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.
推荐阅读
-
Codeforces Round #226 (Div. 2)
-
Codeforces Round #FF (Div. 2) D. DZY Loves Modification 贪心+优先队列_html/css_WEB-ITnose
-
Codeforces Round #266 (Div. 2) B. Wonder Room_html/css_WEB-ITnose
-
Codeforces Round #258 (Div. 2)Devu and Flowers 容斥原理_html/css_WEB-ITnose
-
Codeforces Round #595 (Div. 3)D1D2 贪心 STL
-
Codeforces Round #655 (Div. 2) A. Omkar and Completion
-
Codeforces Round #656 (Div. 3)D. a-Good String(递归+dfs)
-
Codeforces Round #487 (Div. 2)
-
CodeForces 1324 - Codeforces Round #627 (Div. 3)
-
Codeforces Round #649 (Div. 2)-B. Most socially-distanced subsequence(思维)