No.3015 右に寄せろ!
レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限
: 512 MB / 標準ジャッジ問題
タグ : / 解いたユーザー数 157
作問者 :
ngtkana
/ テスター :
ゆにたりー卿
👑
binap
DeltaStruct
Apollo@Kuro
Yama.can
Rice_tawara459
のらら
あじゃじゃ
eom2357
タグ : / 解いたユーザー数 157
作問者 :
ngtkana
/ テスター :
ゆにたりー卿
👑
DeltaStruct
Rice_tawara459
のらら
あじゃじゃ
問題文最終更新日: 2025-01-26 22:07:43
English (AI translation)
Shift to the Right!
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Show the original
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Show the original
第1回 岩井星人アンソロジープログラミングコンテスト
(順位表)
の他の問題:
Problem Statement
Iwai Seijin loves things shifted to the right, and is especially fond of the operation of changing a substring 110 of a string into 011.
Given a string $S$, find the maximum number of times Iwai Seijin can perform this operation.
Constraints
- $S$ is a string of length at least $1$ and at most $2 \times 10 ^ 6$
- $S$ consists of
0and1
Input
The input is given from Standard Input in the following format.
$S$
Output
Output the maximum number of operations that can be performed.
Sample
Sample 1
Input
10110110
Output
3
The string can be changed as 10110110 → 10011110 → 10011011 → 10001111.
Sample 2
Input
0000000010000001111
Output
0
Iwai Seijin cannot shift to the right any further.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。