CC is a smart girl and she is curious about everything. One day she starts to analyze her lifestyle and finds out that she either feels happy or unhappy in any day, then she collects her mood data and makes numerical representation. She writes down 1 if she is happy, otherwise she writes down 0. For example, if CC is happy, happy, unhappy, happy, happy, unhappy in the next 6 days, a numerical sequence which stands for it is 1,1,0,1,1,0 Meanwhile, smart CC finds her mood sequence is always periodic. She also finds the repeated segment like 1,1,0 in the aforementioned example and calls it “feeling repetend”. As a curious girl, CC wants to make another deep analysis. After she gets the length of “feeling repetend” n, she defines a rule: she tries to find a day whose index is d and considers the next d+n-1 days. For each day d' in [d, d+n-1], CC guarantee that the number of happy days is more than unhappy days in [1, d'] days. Now, CC wonder that how many days which satisfy the rule in n “feeling repetend” days.
CC is a smart girl and she is curious about everything. One day she starts to analyze her lifestyle and finds out that she either feels happy or unhappy in any day, then she collects her mood data and makes numerical representation. She writes down 1 if she is happy, otherwise she writes down 0. For example, if CC is happy, happy, unhappy, happy, happy, unhappy in the next 6 days, a numerical sequence which stands for it is 1,1,0,1,1,0 Meanwhile, smart CC finds her mood sequence is always periodic. She also finds the repeated segment like 1,1,0 in the aforementioned example and calls it “feeling repetend”. As a curious girl, CC wants to make another deep analysis. After she gets the length of “feeling repetend” n, she defines a rule: she tries to find a day whose index is d and considers the next d+n-1 days. For each day d' in [d, d+n-1], CC guarantee that the number of happy days is more than unhappy days in [1, d'] days. Now, CC wonder that how many days which satisfy the rule in n “feeling repetend” days.
标签: HBC14650开心的cc题解