Logo
(追記) (追記ここまで)

23787번 - Cyanide Rivers 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB15911410472.222%

문제

Cyanide rivers flowing out from Martian south polar ice cap are quite dangerous due to their toxic contents and any activity in their close proximity is often extremely time consuming.

A row of communication towers has been built in the area, before the rivers even appeared after Martian global warming events.

Some of the towers are now standing directly in a river, some remain standing outside, on the river shores or on islands in the rivers. The first and the last tower in the row stand on river shores.

All towers are to be officially certified for the next operation period in the present difficult conditions.

The towers which are standing on the shore or on an island can be certified immediately. The access to the towers in rivers is hazardous and requires a lot of caution. The certification process of a tower standing in a river takes one whole day. Moreover, a tower standing in a river can be certified only if at least one of its immediate neighbour towers has been certified at least one day earlier. Fortunately, the certification process can be performed independently on each tower, thus it is possible to certify more than one tower in a day.

The certification process has to be completed as soon as possible.

입력

The input consists of one line containing an odd binary number with up to 300 000 digits and with no leading zeros. Each digit represents one tower. Towers standing in a river are represented by 0’s, remaining towers are represented by 1’s. The order of the digits is the same as the order of towers in the row.

출력

Print minimum number of whole days in which all towers can be certified.

제한

예제 입력 1

10100110101

예제 출력 1

1

예제 입력 2

10000010010001

예제 출력 2

3

힌트

출처

ICPC > Regionals > Europe > Central European Regional Contest > CTU Open Contest > CTU Open Contest 2021 R번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /