codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

519B.md (2523B)


      1 Source: https://codeforces.com/problemset/problem/519/B
      2 
      3 B. A and B and Compilation Errors
      4 
      5 time limit per test
      6 
      7 2 seconds
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 stdin
     16 
     17 output
     18 
     19 stdout
     20 
     21 A and B are preparing themselves for programming contests.
     22 
     23 B loves to debug his code. But before he runs the solution and starts debugging, he has to first compile the code.
     24 
     25 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.
     26 
     27 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.
     28 
     29 Can you help B find out exactly what two errors he corrected?
     30 
     31 Input
     32 
     33 The first line of the input contains integer *n* (3 ≤ *n* ≤ 105) — the initial number of compilation errors.
     34 
     35 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.
     36 
     37 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.
     38 
     39 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.
     40 
     41 Output
     42 
     43 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.
     44 
     45 Examples
     46 
     47 Input
     48 
     49 ```
     50 5  
     51 1 5 8 123 7  
     52 123 7 5 1  
     53 5 1 7
     54 ```
     55 
     56 Output
     57 
     58 ```
     59 8  
     60 123
     61 ```
     62 
     63 Input
     64 
     65 ```
     66 6  
     67 1 4 3 3 5 7  
     68 3 7 5 4 3  
     69 4 3 7 5
     70 ```
     71 
     72 Output
     73 
     74 ```
     75 1  
     76 3
     77 ```
     78 
     79 Note
     80 
     81 In the first test sample B first corrects the error number 8, then the error number 123.
     82 
     83 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.