-
Notifications
You must be signed in to change notification settings - Fork 1
/
B.cpp
45 lines (41 loc) · 979 Bytes
/
B.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <bits/stdc++.h>
using namespace std;
int tmp[100009], ara[100009];
int main()
{
int n;
scanf("%d", &n);
bool checker = 0;
for(int i = 0; i < n; i++)
scanf("%d", &tmp[i]);
sort(tmp, tmp + n);
for(int i = 0; i < n; i++)
ara[i] = tmp[i];
for(int i = 0; i < n - 1; i++)
scanf("%d", &tmp[i]);
sort(tmp, tmp + n - 1);
for(int i = 0; i < n - 1; i++) {
if(ara[i] != tmp[i] && checker == 0) {
printf("%d\n", ara[i]);
checker = 1;
}
ara[i] = tmp[i];
}
if(checker == 0) {
printf("%d\n", ara[n - 1]);
}
checker = 0;
for(int i = 0; i < n - 2; i++)
scanf("%d", &tmp[i]);
sort(tmp, tmp + n - 2);
for(int i = 0; i < n - 2; i++) {
if(ara[i] != tmp[i]) {
printf("%d\n", ara[i]);
checker = 1;
break;
}
}
if(checker == 0)
printf("%d\n", ara[n - 2]);
return 0;
}