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

32889번 - Alphabetical Aristocrats 다국어

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

문제

It is the year 1830 of our Lord, 15 years after the Kingdom of the Netherlands gained independence from its French oppressors. You are secretary of state and aide to his highness William I, Grand Duke of Luxembourg and King of the Netherlands -- an empire that is destined to prosper and stretch across centuries to come. To the King's utter dismay, rogue scoundrels from the south recently dared to defy his benevolent rule. They call themselves Belgians and declared their own kingdom -- a fact that his highness will surely deny for at least another seven to eleven years. King William, in all his wisdom, decided to call upon the most trusted noblemen to scheme a campaign against the insubordinate elements that will last more than nine days.

You are to assemble a list of trustworthy royalty and sort them according to the Dutch rules. The Dutch rules state that surnames are to be compared lexicographically, according to the values of the ASCII characters, and considering only the part starting from the first capital letter. For example, King William compares the surname of his favourite painter Abraham van den Hecken the Younger according to Hecken the Younger.

입력

The input consists of:

  • One line with an integer $n$ (1ドル\leq n\leq 1000$), the number of surnames.
  • $n$ lines, each with a string $s$ (1ドル\leq |s|\leq50$), one of the surnames. The surnames consist of English letters, spaces, and apostrophes (A-Z, a-z, '', ''').

It is guaranteed that the part starting with the first capital letter is unique. Names have no leading, trailing, or consecutive spaces.

출력

Output the list of surnames, sorted according to the Dutch rules.

제한

예제 입력 1

7
van der Steen
fakederSteenOfficial
Groot Koerkamp
Bakker
van den Hecken the Younger
de Waal
van 't Hek

예제 출력 1

Bakker
Groot Koerkamp
van den Hecken the Younger
van 't Hek
van der Steen
fakederSteenOfficial
de Waal

예제 입력 2

5
var Emreis
an Gleanna
Terzieff Godefroy
aep Ceallach
of Rivia

예제 출력 2

aep Ceallach
var Emreis
an Gleanna
of Rivia
Terzieff Godefroy

예제 입력 3

7
van den Brand
den Brand Heek
Brand 'Heek
van Brand heek
DeN bRAnD hEeK
den brandHeek
der Brandheek

예제 출력 3

van den Brand
Brand 'Heek
den Brand Heek
van Brand heek
der Brandheek
DeN bRAnD hEeK
den brandHeek

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > NWERC 2024 A번

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

출처

대학교 대회

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

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