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

15238번 - Pirates 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB88666860677.692%

문제

Pirates talk a funny way. They say word where the letters are repeated more than they need to be. We would like know which letter appears the most frequently in a Pirate word.

For example: In the word “arrrrrghh”, the letter “r” appears 5 times while “h” appears twice.

Write a program that reads a pirate word from the terminal and writes the letter that occurs most frequently.

It is guaranteed that only one letter is the most repeated. That is, words like “aipo” won’t appear because no single letter wins.

입력

The input will consist of two lines.

The first line will contain the size of the word and the second the word to process.

The word will only contain lowercase letters from a to z. The size of the word will be at most 1000 characters. No spaces or other symbols will appear.

출력

Print a single line with the character that appears the most and the number of occurrences.

제한

예제 입력 1

10
arrrrrrghh

예제 출력 1

r 6

예제 입력 2

9
shhhiiver

예제 출력 2

h 3

예제 입력 3

20
oxlbelhfikrzxcgxpfcy

예제 출력 3

x 3

힌트

출처

Olympiad > All-Ireland Programming Olympiad > 2017 AIPO National Finals 1번

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

출처

대학교 대회

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

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