对称二进制子串
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Description
给定一个只包含0、1的字符串s,找出有相同数量0和1,且所有0和所有1都是组合在一起的子字符串数量。
例如“00110011”有6个子串具有相同数量的连续1和0:
“0011”,“01”,“1100”,“10”,“0011” 和 “01”,
子串“00110011”不是有效的,因为它的0和1没有组合在一起。
Input Format
字符串s,长度在1到50,000之间。
数据范围为,如果使用的算法,程序可能会超过每秒次运算导致超时。
Output Format
满足要求的子串数量
10101
4
Source
基础百练 数组与字符串
2019蓝桥杯赛前训练Week1
- Status
- Done
- Rule
- ACM/ICPC
- Problem
- 7
- Start at
- 2019-1-17 9:00
- End at
- 2019-2-1 23:59
- Duration
- 375 hour(s)
- Host
- Partic.
- 24