| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 4 초 | 2048 MB | 32 | 24 | 17 | 70.833% |
Both winning BAPC and publishing research papers is a team effort. And every member of the team wants to be appreciated.
Every research paper has a list of authors at the top. Each author is listed using their full name, which might consist of several parts.
To avoid arguments about the order of names, your team decided to just order the list of names in the following way:
However, your team already submitted the draft for your paper before you came up with this idea.
You are given the list of author as presented in the draft. Is it possible to pick name parts in a way that the list of authors in the draft is sorted?
The input consists of:
Each name part has at most $10$ characters and consists of one English uppercase letter (A-Z), followed by only English lowercase letters (a-z).
If it is possible to select a name part for each author such that the list is sorted, output for each author the selected name part. Otherwise, output "impossible".
If there are multiple valid solutions, you may output any one of them.
6 2 Maria Douglas 3 Ozzy Levi Carpenter 3 Quentin Aaron Potter 2 Christy Iglesias 2 Mo Mansur 3 Sam Marlon Scully
impossible
4 2 Maria Douglas 3 Ozzy Levi Carpenter 3 Quentin Aaron Potter 3 Sam Marlon Scully
Maria Ozzy Potter Scully
3 1 Sam 1 Sam 1 Sam
Sam Sam Sam
ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2025 Preliminaries J번