RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
COCI00504

Magnus

Unrated 레이팅 미적용
난이도
1s
시간 제한
64MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

1 \(s / 64\) \(MB / 50\) points

Magnus lost a game of chess to Kile so he found comfort in competitive programming. Very soon, he

heard of the iconic COCI competition and decided to try his luck there.

He wrote a mail to Kile: “ Dear Kile, please, prepare me for COCI. Magnus ”.
Kile replied: “ You want \(to\) participate \(in\) COCI? All right, here's your wa\(rm-up\) task. \(A\) series \(of\) four

consecutive letters \(of\) some word that make \(up\) the subword “HONI” (Croatian acronym for COCI) \(is\)

called the HO\(NI-bl\)ock. \(I\) will send you the word \(of\) length N and you will throw out as many letters as

you want (it might \(be\) none \(as\) well) \(so\) that \(in\) the end there are as many HO\(NI-bl\)ocks as possible in

the word. Kile ”.

Magnus was very worried and asked you, COCI competitive scene, for help. Help him determine the

maximum number of HO\(NI-bl\)ocks he can get in the final word.

제약
입력 형식

The first line contains a word of length \(N\) (1 ≤ \(N \le 100\,000\)), consisting of uppercase letters of the

English alphabet.

출력 형식

In the first and only line print out the required number of HO\(NI-bl\)ocks.

예제 1
입력
MAGNUS

HHHHOOOONNNNIIII

PROHODNIHODNIK
출력
output
output
0

1

2
설명

Explanation of the second sample test:
By throwing out three letters ‘H’, ‘O’, ‘N’ or ‘I’ Magnus can get the word “HONI”, which contains one HONI-block.

문제 정보

생성자가 기록되지 않았습니다.

출처 COCI 2018/2019 Contest 3

평가 및 의견

Magnus

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Magnus

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8