QOJ.ac

QOJ

时间限制: 2.0 s 内存限制: 1024 MB 总分: 100

#15452. ICPC 隔离

统计

在 AMPPZ 2025 中,来自 27 所高校的 80 支队伍将同台竞技。这些高校的缩写分别为:UW, UJ, UWR, MAP, PW, AGH, PG, NLU, PUT, PO, PWR, SGGW, UMCS, UR, ZUT, DTP, GOO, HUA, KUL, PL, PM, PS, UAM, UG, UMK, UO, WAT。以下是展示每所高校队伍数量的完整表格*:

学校全称 缩写 队伍数量
Uniwersytet Warszawski UW 11
Uniwersytet Jagielloński UJ 9
Uniwersytet Wrocławski UWR 8
Mistrzostwa w Algorytmice i Programowaniu (secondary schools) MAP 7
Politechnika Warszawska PW 6
Akademia Górniczo-Hutnicza im. Stanisława Staszica w Krakowie AGH 5
Politechnika Gdańska PG 4
Wyższa Szkoła Biznesu - National-Louis University NLU 3
Politechnika Poznańska PUT 3
Politechnika Opolska PO 2
Politechnika Wrocławska PWR 2
Szkoła Główna Gospodarstwa Wiejskiego w Warszawie SGGW 2
Uniwersytet Marii Curie-Skłodowskiej w Lublinie UMCS 2
Uniwersytet Rzeszowski UR 2
Zachodniopomorski Uniwersytet Technologiczny w Szczecinie ZUT 2
Digital Technology Poland DTP 1
Google GOO 1
Huawei HUA 1
Katolicki Uniwersytet Lubelski Jana Pawła II KUL 1
Politechnika Łódzka PL 1
Politechnika Morska w Szczecinie PM 1
Politechnika Śląska PS 1
Uniwersytet im. Adama Mickiewicza w Poznaniu UAM 1
Uniwersytet Gdański UG 1
Uniwersytet Mikołaja Kopernika w Toruniu UMK 1
Uniwersytet Opolski UO 1
Wojskowa Akademia Techniczna WAT 1

* 在本题准备阶段与实际比赛之间,队伍列表可能会有轻微变化。

比赛大厅是一个 $8 \times 10$ 的网格,由 8 行组成,每行有 10 个工作站。为了防止未经授权的交流,组织者必须找到一种座位安排方案,使得来自同一所高校的队伍不相邻——即既不共用边,也不共用角。

观众有他们最喜爱的队伍——来自输入中给出缩写的那所高校的队伍。摄像团队已经在大厅的左上角架设好了摄像机,因此来自输入中给定高校的一支队伍必须坐在那里。

请找到满足上述条件的任意一种队伍安排方案。

输入格式

唯一的一行包含一个由 2 到 4 个大写字母组成的单词——最喜爱高校的缩写(上述 27 所高校之一)。

输出格式

输出找到的队伍安排方案——共 8 行,每行包含 10 个以空格分隔的单词(高校缩写)。

第一行的第一个单词必须与输入中给出的最喜爱高校相匹配。如果存在多种解,输出其中任意一种即可。

说明

在样例测试中,观众最喜爱的高校是 Uniwersytet Wrocławski†。给出的输出包含了正确的缩写和数量,且 UWR 确实出现在了左上角。然而,这不是一个有效的输出,因为在许多地方,来自同一所高校的队伍相邻了。在下方表格中,展示了这一无效输出(在原题中,部分冲突位置被灰色高亮标出)。

UWR MAP MAP UJ PL UW UW SGGW ZUT GOO
MAP PUT UR KUL UW UW PM AGH UWR AGH
PS UJ UWR UW UWR MAP UWR PG UWR PWR
PW HUA PW AGH PG DTP UW UW UW PWR
MAP UG NLU UJ PUT UAM UW UJ UJ UW
NLU ZUT PW WAT UWR AGH UMCS UR UJ AGH
PUT UJ SGGW PG PW MAP PO MAP UJ UWR
UMCS PO PW PW UO UW PG UJ NLU UMK

† 也许是因为 UWR 的其中一支队伍赢得了上一届 AMPPZ。

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.