QOJ.ac

QOJ

حد الوقت: 1.0 s حد الذاكرة: 256 MB مجموع النقاط: 100

#15657. 微硕士证书

الإحصائيات

计算机工程系提供了若干个微硕士(micromasters)项目,每个项目都包含一个课程体系。如果学生成功完成了某个微硕士项目的所有课程,他将获得该微硕士项目的证书。一门课程可以包含在多个微硕士项目的课程体系中。

Soroush 只想着拿到证书,并不关心证书的类型,他希望通过修读尽可能少数量的课程来获得至少 3 个微硕士证书。

微硕士项目的课程体系张贴在公告栏上。请根据这些微硕士课程体系,帮助 Soroush 实现他的目标。

输入格式

输入表示一个公告栏。公告栏最多包含 400 行和 400 列。

每个微硕士课程体系都被封装在一个矩形框中。公告栏和课程体系框的边界分别由字符 “+”、“-” 和 “|” 表示,分别代表角、水平边和垂直边。

课程体系框是互不相交的(没有公共字符),且每个框都有自己的边界。

课程体系框内的每一行最多包含一个课程名称。

课程名称由字母数字字符和空格组成。课程名称不区分大小写,且其中的空格不影响其唯一性。例如,“General math1” 和 “generalMath 1” 是相同的课程。

公告栏上最多有 50 个课程体系框,每个框最多包含 30 门课程。

保证公告栏上至少有 3 个框,且每个框中至少有 1 门课程。

输出格式

输出单行,包含 Soroush 为了获得至少 3 个证书而需要修读的最少课程数量。

样例

输入样例 1

+-------------------------------------------------+
| +-------------------+                           |
| |Algorithm Design   |   +-------------------+   |
| | Programming       |   |PROGRAMMING        |   |
| |Discrete Structures|   |  Web Prgramming   |   |
| |  Data Structures  |   |                   |   |
| +-------------------+   | DatabaseDesign    |   |
|                         |Software Test      |   |
|      +--------------+   |   Patterns        |   |
|      |    Python    |   +-------------------+   |
|      +--------------+                           |
|   +------------------------+                    |
|   |Programming             |                    |
|   |          AI            |                    |
|   |    Algorithm    design |                    |
|   |Database Design         |                    |
|   +------------------------+                    |
+-------------------------------------------------+

输出样例 1

8

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.