QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 1024 MB Total points: 100 Difficulty: [show] Hackable ✓

#6185. Best Problem

統計

给定一个二进制字符串 $S$。你可以执行任意次数以下操作:

  • 将一个子串 ‘0101’ 替换为 ‘1010’。

你能执行的最大操作次数是多少?

输入格式

一个二进制字符串 $S$ ($1 \le |S| \le 5 \times 10^6$)。

输出格式

一个整数,即答案。

样例

输入 1

10100010011001011111

输出 1

5

输入 2

0000010101100110101101010110000110100111000010010111111100101101110101000111101111010101010010101010

输出 2

58

Discussions

About Discussions

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.

Open Discussions 0
No discussions in this category.

Issues

About Issues

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:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.