QOJ.ac

QOJ

Límite de tiempo: 2 s Límite de memoria: 1024 MB Puntuación total: 100

#2749. 孤立备份

Estadísticas

GigantoCorp 遇到了一个问题。他们已经从数据中心移除了所有的磁带驱动器,并将所有备份存储到磁盘上。然而,他们似乎使用的磁盘空间比备份软件显示应占用的空间要多。他们认为备份存储中存在一些不在备份软件索引中的文件。他们希望你的团队编写一个程序,来确定备份存储中是否存在不在索引中的“孤儿”文件,或者是否存在没有对应备份文件的“孤儿”索引条目。

你的程序将获得两个列表——一个有效备份映像名称的索引,以及随后的备份文件名列表。

你的程序需要比较这两个列表,并确定是否存在索引中没有对应文件的备份映像,或者是否存在与索引中任何备份映像都不关联的文件。

输入格式

输入分为两个部分。

第一部分是备份映像列表,每行一个。每个备份映像名称由 1 到 32 个可打印 ASCII 字符组成(不含空格)。最多可能有 100,000 个映像。每个映像名称都是唯一的,且它们可以以任何顺序出现。

该部分的结束由一个空行标记。

第二部分包含备份文件名列表,每行一个,左对齐。备份文件名的格式为 imageName_integer_type,其中 imageName 是上述格式的备份映像名称,integer 是一个范围在 $0 \dots 2\,000\,000\,000$ 之间的整数,表示自 1970 年 1 月 1 日 00:00 GMT(“UNIX 纪元”)以来的秒数,type 是一个由 1 到 6 个大写字母组成的字符串。最多可能有 300,000 个备份文件名。文件名是唯一的,且它们可以以任何顺序出现。

该部分的结束由文件结束符标记。

输出格式

首先,打印没有索引条目的文件列表,每行一个,格式为字符“F”、一个空格,然后是文件名。

在打印完所有孤儿文件后,打印孤儿索引条目,每行一个,格式为字符“I”、一个空格,然后是备份映像名称。

每个列表中的条目都应按 ASCII 字典序打印。

如果每个文件都有对应的索引条目,且每个索引条目都有一个或多个文件,则仅打印一行包含字符串“No mismatches.”的内容。

样例

输入格式 1

payroll.xls
projects.doc
employees.dat
products.txt

payroll.xls_1539199053_INCR
employees.dat_1539199053_INCR
payroll.xls_1539112653_INCR
employees.dat_1539112653_INCR
payroll.xls_1539026253_FULL
employees.dat_1539026253_FULL
customers.dat_1539026253_FULL

输出格式 1

F customers.dat_1539026253_FULL
I products.txt
I projects.doc

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.