给定一个由大写字母组成的字符串 $S$,请重新排列 $S$ 中字符的顺序,使得子串 CCPC 作为连续子串出现的次数尽可能多。你需要求出 CCPC 出现次数的最大值。
输入格式
一行,包含一个由大写字母组成的字符串 $S$ ($1 \le |S| \le 10^6$)。
输出格式
输出一个整数,表示 CCPC 出现次数的最大值。
样例
样例输入 1
ABCDCPCPC
样例输出 1
1
给定一个由大写字母组成的字符串 $S$,请重新排列 $S$ 中字符的顺序,使得子串 CCPC 作为连续子串出现的次数尽可能多。你需要求出 CCPC 出现次数的最大值。
一行,包含一个由大写字母组成的字符串 $S$ ($1 \le |S| \le 10^6$)。
输出一个整数,表示 CCPC 出现次数的最大值。
ABCDCPCPC
1
The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.
This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.
If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.
Guidelines: