CF519B.A and B and Compilation Errors
普及-
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
A and B are preparing themselves for programming contests.
B loves to debug his code. But before he runs the solution and starts debugging, he has to first compile the code.
Initially, the compiler displayed n compilation errors, each of them is represented as a positive integer. After some effort, B managed to fix some mistake and then another one mistake.
However, despite the fact that B is sure that he corrected the two errors, he can not understand exactly what compilation errors disappeared — the compiler of the language which B uses shows errors in the new order every time! B is sure that unlike many other programming languages, compilation errors for his programming language do not depend on each other, that is, if you correct one error, the set of other error does not change.
Can you help B find out exactly what two errors he corrected?
A 和 B 正在为编程竞赛做准备。
B 喜欢调试自己的代码。但在运行程序并开始调试之前,他必须先编译代码。
最初,编译器显示了 n 个编译错误,每个错误均用一个正整数表示。经过一番努力,B 成功修复了一个错误,接着又修复了另一个错误。
然而,尽管 B 确信自己已修正了这两个错误,他却无法准确判断是哪两个编译错误消失了——因为 B 所使用的编程语言的编译器每次显示错误时,都会以一种新的顺序呈现!B 确信,与许多其他编程语言不同,他所用语言的编译错误之间彼此独立:即,若你修正其中一个错误,其余错误的集合不会因此发生任何变化。
你能帮 B 准确找出他修正的是哪两个错误吗?
输入格式
The first line of the input contains integer n (3 ≤ n ≤ 105) — the initial number of compilation errors.
The second line contains n space-separated integers _a_1, _a_2, ..., a__n (1 ≤ a__i ≤ 109) — the errors the compiler displayed for the first time.
The third line contains n - 1 space-separated integers _b_1, _b_2, ..., b__n - 1 — the errors displayed at the second compilation. It is guaranteed that the sequence in the third line contains all numbers of the second string except for exactly one.
The fourth line contains n - 2 space-separated integers _с_1, _с_2, ..., с__n - 2 — the errors displayed at the third compilation. It is guaranteed that the sequence in the fourth line contains all numbers of the third line except for exactly one.
输入的第一行包含一个整数 $ n ( 3 \leq n \leq 10^5 $)——初始的编译错误数量。
第二行包含 $ n $ 个以空格分隔的整数 $ a_1,,a_2,,\dots,,a_n ( 1 \leq a_i \leq 10^9 $)——编译器第一次编译时报告的错误。
第三行包含 $ n-1 $ 个以空格分隔的整数 $ b_1,,b_2,,\dots,,b_{n-1} $——第二次编译时报告的错误。保证第三行中的序列恰好缺少第二行序列中的一个数,其余数字均存在。
第四行包含 $ n-2 $ 个以空格分隔的整数 $ c_1,,c_2,,\dots,,c_{n-2} $——第三次编译时报告的错误。保证第四行中的序列恰好缺少第三行序列中的一个数,其余数字均存在。
输出格式
Print two numbers on a single line: the numbers of the compilation errors that disappeared after B made the first and the second correction, respectively.
在同一行输出两个数字:分别表示在 B 进行第一次和第二次修正后消失的编译错误的数量。
输入输出样例
输入#1
5 1 5 8 123 7 123 7 5 1 5 1 7
输出#1
8 123
输入#2
6 1 4 3 3 5 7 3 7 5 4 3 4 3 7 5
输出#2
1 3
说明/提示
In the first test sample B first corrects the error number 8, then the error number 123.
In the second test sample B first corrects the error number 1, then the error number 3. Note that if there are multiple errors with the same number, B can correct only one of them in one step.
在第一个测试样例中,B 首先修正错误编号 8,然后修正错误编号 123。
在第二个测试样例中,B 首先修正错误编号 1,然后修正错误编号 3。注意:若存在多个编号相同的错误,B 每步只能修正其中的一个。
输入解题思路,AI测评打分。不知道怎么写?