포럼
문제 ICPC00220

A. Alphabetical Aristocrats

설명

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
출력
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
출력
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
출력
van den Brand
Brand 'Heek
den Brand Heek
van Brand heek
der Brandheek
DeN bRAnD hEeK
den brandHeek
문제 정보

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

출처 ICPC NWERC 2024

평가 및 의견

A. Alphabetical Aristocrats

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

Log in to rate problems.

개별 의견

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

풀이 제출

A. Alphabetical Aristocrats

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