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

18294번 - Biodiversity 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 512 MB46624318849.604%

문제

Alicia has a huge garden which is the habitat of many animals that she really cares about. After listening to a podcast about biodiversity, she becomes very concerned about the balance between species in her garden. She wants to know if there is a species that could overtake the others. In order to do so, she decides to carry out a census of all animals in the garden, writing down the species of each of them. Can you help her checking if there is strictly more animals from one species than the animals from all others species together?

입력

The input consists of the following lines:

  • on the first line: an integer N;
  • on each of the next N lines: the species of an animal as a string of length at most 20, containing only ASCII alphanumeric characters.

출력

A string that appears a number of times that is greater than the sum of the others, if there is any, or the string “NONE” otherwise.

제한

  • 1 ≤ N ≤ 2 × 105

예제 입력 1

3
frog
fish
frog

예제 출력 1

frog

예제 입력 2

4
cat
mouse
mouse
cat

예제 출력 2

NONE

힌트

출처

ICPC > Regionals > Europe > Southwestern European Regional Contest > SWERC 2019 B번

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

출처

대학교 대회

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

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