text
stringlengths 49
983k
|
|---|
#include <bits/stdc++.h>
using namespace std;
int main() {
long int n, i;
cin >> n;
long int a[n], b[n - 1], c[n - 2];
for (i = 0; i < n; i++) {
cin >> a[i];
}
for (i = 0; i < n - 1; i++) {
cin >> b[i];
}
for (i = 0; i < n - 2; i++) {
cin >> c[i];
}
sort(a, a + n);
sort(b, b + n - 1);
sort(c, c + n - 2);
int t = 0;
for (i = 0; i < n - 1; i++) {
if (a[i] != b[i]) {
t = 1;
cout << a[i] << "\n";
break;
}
}
if (t == 0) cout << a[n - 1] << "\n";
int l = 0;
for (i = 0; i < n - 2; i++) {
if (b[i] != c[i]) {
l = 1;
cout << b[i] << "\n";
break;
}
}
if (l == 0) cout << b[n - 2] << "\n";
}
|
#include <bits/stdc++.h>
using namespace std;
int n, x;
int a[100005], b[100005], c[100005];
int main() {
cin >> n;
for (int i = 0; i < n; i++) cin >> a[i];
for (int i = 0; i < n - 1; i++) cin >> b[i];
for (int i = 0; i < n - 2; i++) cin >> c[i];
sort(a, a + n);
sort(b, b + (n - 1));
sort(c, c + (n - 2));
int f = 0;
for (int i = 0; i < n - 1; i++) {
if (a[i] != b[i]) {
f = a[i];
break;
}
}
if (f != 0)
cout << f << endl;
else
cout << a[n - 1] << endl;
f = 0;
for (int i = 0; i < n - 2; i++) {
if (b[i] != c[i]) {
f = b[i];
break;
}
}
if (f == 0)
cout << b[n - 2] << endl;
else
cout << f << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> ans(2);
multiset<int> first, second, third;
for (int i = 0; i < n; i++) {
int temp;
cin >> temp;
first.insert(temp);
}
for (int i = 0; i < n - 1; i++) {
int temp;
cin >> temp;
second.insert(temp);
}
for (int i = 0; i < n - 2; i++) {
int temp;
cin >> temp;
third.insert(temp);
}
set_difference(first.begin(), first.end(), second.begin(), second.end(),
ans.begin());
set_difference(second.begin(), second.end(), third.begin(), third.end(),
ans.begin() + 1);
cout << ans[0] << "\n";
cout << ans[1] << "\n";
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
long long sA = 0, sB = 0, sC = 0;
cin >> n;
std::vector<long long> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
sA += a[i];
}
std::vector<long long> b(n - 1);
for (int i = 0; i < n - 1; i++) {
cin >> b[i];
sB += b[i];
}
std::vector<long long> c(n - 2);
for (int i = 0; i < n - 2; i++) {
cin >> c[i];
sC += c[i];
}
cout << sA - sB << "\n" << sB - sC << "\n";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int n, x = 0, m = 0, j = 0, i, a[100005], b[100005], c[100005],
d[100005];
scanf("%lld", &n);
for (i = 0; i < n; i++) {
scanf("%lld", &a[i]);
}
for (i = 0; i < n - 1; i++) {
scanf("%lld", &b[i]);
}
for (i = 0; i < n - 2; i++) {
scanf("%lld", &c[i]);
}
sort(a, a + n);
sort(b, b + n - 1);
sort(c, c + n - 2);
for (i = 0; i < n; i++) {
if (b[j] != a[i]) {
printf("%d\n", a[i]);
break;
}
j++;
}
j = 0;
for (i = 0; i < n - 1; i++) {
if (c[j] != b[i]) {
printf("%d\n", b[i]);
break;
}
j++;
}
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, a[100004], b[100004], c[100004], i, p = 0, j;
long long suma = 0, sumb = 0, sumc = 0;
cin >> n;
for (i = 0; i < n; i++) {
cin >> a[i];
suma += a[i];
}
for (i = 0; i < n - 1; i++) {
cin >> b[i];
sumb += b[i];
}
for (i = 0; i < n - 2; i++) {
cin >> c[i];
sumc += c[i];
}
cout << suma - sumb << endl << sumb - sumc << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int n;
cin >> n;
long long int a[n], b[n], c[n], x[n], v[n], s1 = 0, s2 = 0, s3 = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
s1 += a[i];
}
for (int i = 0; i < n - 1; i++) {
cin >> b[i];
s2 += b[i];
}
for (int i = 0; i < n - 2; i++) {
cin >> c[i];
s3 += c[i];
}
cout << s1 - s2 << endl << s2 - s3 << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[n + 1], b[n + 1], c[n + 1];
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i = 0; i < n - 1; i++) {
cin >> b[i];
}
for (int i = 0; i < n - 2; i++) {
cin >> c[i];
}
sort(a, a + n);
sort(b, b + n - 1);
sort(c, c + n - 2);
for (int i = 0; i < n; i++) {
if (a[i] != b[i]) {
cout << a[i] << endl;
break;
}
}
for (int i = 0; i < n - 1; i++) {
if (b[i] != c[i]) {
cout << b[i] << endl;
break;
}
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int x;
long long sum1 = 0, sum2 = 0, sum3 = 0;
for (int i = 0; i < n; i++) {
cin >> x;
sum1 += x;
}
for (int i = 0; i < n - 1; i++) {
cin >> x;
sum2 += x;
}
for (int i = 0; i < n - 2; i++) {
cin >> x;
sum3 += x;
}
cout << sum1 - sum2 << endl;
cout << sum2 - sum3 << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 * 100 + 5;
int a[maxn], b[maxn], c[maxn];
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++) cin >> a[i];
for (int i = 0; i < n - 1; i++) cin >> b[i];
for (int i = 0; i < n - 2; i++) cin >> c[i];
sort(a, a + n);
sort(b, b + n - 1);
sort(c, c + n - 2);
for (int i = 0; i < n; i++) {
if (a[i] != b[i]) {
cout << a[i] << endl;
break;
}
}
for (int i = 0; i < n - 1; i++) {
if (b[i] != c[i]) {
cout << b[i] << endl;
break;
}
}
return false;
}
|
#include <bits/stdc++.h>
using namespace std;
long long sum(vector<long long> arr) {
long long s = 0;
for (int i = 0; i < arr.size(); i++) s += arr[i];
return s;
}
int main() {
int n, i;
long long x;
cin >> n;
vector<long long> arr, arr1;
for (i = 0; i < n; i++) {
cin >> x;
arr.push_back(x);
}
for (i = 0; i < n - 1; i++) {
cin >> x;
arr1.push_back(x);
}
long long res = sum(arr) - sum(arr1);
arr.clear();
for (i = 0; i < n - 2; i++) {
cin >> x;
arr.push_back(x);
}
cout << res << endl;
cout << sum(arr1) - sum(arr);
}
|
#include <bits/stdc++.h>
using namespace std;
const long long mod = (long long)1e9 + 7;
void solve() {
int n;
cin >> n;
int a[n], b[n - 1], c[n - 2];
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
for (int i = 0; i < n - 1; ++i) {
cin >> b[i];
}
for (int i = 0; i < n - 2; ++i) {
cin >> c[i];
}
sort(a, a + n);
sort(b, b + n - 1);
sort(c, c + n - 2);
int ans = a[n - 1];
for (int i = 0; i < n - 1; ++i) {
if (a[i] == b[i]) {
continue;
} else {
ans = a[i];
break;
}
}
cout << ans << '\n';
ans = b[n - 2];
for (int i = 0; i < n - 2; ++i) {
if (c[i] == b[i]) {
continue;
} else {
ans = b[i];
break;
}
}
cout << ans << '\n';
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
;
int test = 1;
while (test--) {
solve();
cout << '\n';
}
return 0;
}
|
#include <bits/stdc++.h>
int main() {
int n, e, a, awwl, one, two;
a = n = e = awwl = one = two = 0;
scanf("%d", &n);
getchar();
e = n;
while (e--) {
scanf("%d", &a);
getchar();
awwl += a;
}
e = n - 1;
while (e--) {
scanf("%d", &a);
getchar();
one += a;
}
printf("%d\n", awwl - one);
e = n - 2;
while (e--) {
scanf("%d", &a);
getchar();
two += a;
}
printf("%d\n", one - two);
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
long long int a[1000005] = {0}, b[100005] = {0}, c[100005] = {0}, n, x, y;
int main() {
int i, h, j, k, l;
scanf("%I64d", &n);
for (i = 0; i < n; i++) scanf("%I64d", &a[i]);
for (i = 0; i < n - 1; i++) scanf("%I64d", &b[i]);
for (i = 0; i < n - 2; i++) scanf("%I64d", &c[i]);
sort(a, a + n);
sort(b, b + n - 1);
sort(c, c + n - 2);
for (i = 0; i < n; i++) {
if (a[i] != b[i]) {
x = a[i];
break;
}
}
for (i = 0; i < n - 1; i++) {
if (c[i] != b[i]) {
y = b[i];
break;
}
}
cout << x << endl;
cout << y << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int a[3] = {0, 0, 0}, n, temp;
cin >> n;
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < n - i; ++j) {
cin >> temp;
a[i] += temp;
}
}
cout << a[0] - a[1] << endl << a[1] - a[2] << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
template <class T>
T pwr(T b, T p) {
T r = 1, x = b;
while (p) {
if (p & 1) r *= x;
x *= x;
p = (p >> 1);
}
return r;
}
template <class T>
T lcm(T a, T b) {
return (a / __gcd(a, b)) * b;
}
template <class T>
T sqr(T a) {
return a * a;
}
template <class T>
void xswap(T &x, T &y) {
if (x != y) {
x ^= y;
y ^= x;
x ^= y;
}
}
template <typename T>
inline bool isOn(T &mask, int pos) {
return ((mask) & (1LL << pos));
}
template <typename T>
inline T setf(T mask, int pos) {
return mask = ((mask) & (~(1LL << pos)));
}
template <typename T>
inline T sett(T mask, int pos) {
return mask = ((mask) | (1LL << pos));
}
template <typename T>
inline T flip(T mask, int pos) {
return mask = ((mask) ^ (1LL << pos));
}
template <class T1>
void put(T1 e) {
cout << e << endl;
}
template <class T1, class T2>
void put(T1 e1, T2 e2) {
cout << e1 << " " << e2 << endl;
}
template <class T1, class T2, class T3>
void put(T1 e1, T2 e2, T3 e3) {
cout << e1 << " " << e2 << " " << e3 << endl;
}
template <class T1, class T2, class T3, class T4>
void put(T1 e1, T2 e2, T3 e3, T4 e4) {
cout << e1 << " " << e2 << " " << e3 << " " << e4 << endl;
}
template <class T1, class T2, class T3, class T4, class T5>
void put(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5) {
cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << endl;
}
template <class T1>
void putv(vector<T1> e1) {
for (int i = 0; i < e1.size(); i++)
(!i ? cout << e1[i] : cout << " " << e1[i]);
cout << endl;
}
template <class T1>
void puta(T1 arr[], int l) {
for (int i = 0; i < l; i++) (!i ? cout << arr[i] : cout << " " << arr[i]);
cout << endl;
}
template <class T1>
bool tk(T1 &e1) {
return (cin >> e1 ? true : false);
}
template <class T1, class T2>
bool tk(T1 &e1, T2 &e2) {
return (cin >> e1 >> e2 ? true : false);
}
template <class T1, class T2, class T3>
bool tk(T1 &e1, T2 &e2, T3 &e3) {
return (cin >> e1 >> e2 >> e3 ? true : false);
}
template <class T1, class T2, class T3, class T4>
bool tk(T1 &e1, T2 &e2, T3 &e3, T4 &e4) {
return (cin >> e1 >> e2 >> e3 >> e4 ? true : false);
}
map<int, int> er;
map<int, int> er2;
map<int, int> er3;
int main() {
int n, tmp, mx = -9;
tk(n);
for (int i = 0; i <= n - 1; ++i) {
tk(tmp);
mx = max(mx, tmp);
er[tmp]++;
}
for (int i = 0; i <= n - 2; ++i) {
tk(tmp);
er2[tmp]++;
}
for (typeof((er).begin()) it = (er.begin()); it != (er).end(); ++it) {
if (it->second == er2[it->first] + 1) {
put(it->first);
(it->second)--;
break;
}
}
for (int i = 0; i <= n - 3; ++i) {
tk(tmp);
er3[tmp]++;
}
for (typeof((er2).begin()) it = (er2.begin()); it != (er2).end(); ++it) {
if (it->second == er3[it->first] + 1) {
put(it->first);
(it->second)--;
break;
}
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int n;
void solve() {
int i, j, x, sum = 0, a;
vector<int> ans;
map<int, int> m, m1;
map<int, int>::iterator it;
for (i = 0; i < n; i++) {
scanf("%d", &a);
m[a]++;
sum += a;
}
for (i = 0; i < n - 1; i++) {
scanf("%d", &a);
m1[a]++;
}
for (it = m.begin(); it != m.end(); it++) {
if (it->second - m1[it->first] == 1) {
ans.push_back(it->first);
}
}
x = 0;
for (i = 0; i < n - 2; i++) {
scanf("%d", &a);
x += a;
}
printf("%d\n%d", ans[0], sum - x - ans[0]);
return;
}
int main() {
scanf("%d", &n);
solve();
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int TESTS = 1;
while (TESTS--) {
int n;
cin >> n;
vector<long long int> a(n);
vector<long long int> b(n - 1);
vector<long long int> c(n - 2);
for (long long int i = 0; i < n; i++) cin >> a[i];
for (long long int i = 0; i < n - 1; i++) cin >> b[i];
for (long long int i = 0; i < n - 1; i++) cin >> c[i];
int x, y, ans1, ans2;
x = (a[0] ^ b[0]);
for (long long int i = 1; i < n - 1; i++) x = (x ^ a[i] ^ b[i]);
ans1 = (x ^ a[n - 1]);
y = (b[0] ^ c[0]);
for (long long int i = 1; i < n - 2; i++) y = (y ^ b[i] ^ c[i]);
ans2 = (y ^ b[n - 2]);
cout << ans1 << "\n" << ans2;
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int a[100005];
int b[100005];
int c[100005];
int n, x, ans1 = -1, ans2 = -1;
int main() {
scanf("%d", &n);
for (int i = 0; i < n; ++i) scanf("%d", a + i);
sort(a, a + n);
for (int i = 0; i < n - 1; ++i) scanf("%d", b + i);
sort(b, b + n - 1);
for (int i = 0; i < n - 2; ++i) scanf("%d", c + i);
sort(c, c + n - 2);
for (int i = 0; i < n - 1; ++i)
if (a[i] != b[i]) {
ans1 = a[i];
break;
}
for (int i = 0; i < n - 2; ++i)
if (b[i] != c[i]) {
ans2 = b[i];
break;
}
if (ans1 == -1) ans1 = a[n - 1];
if (ans2 == -1) ans2 = b[n - 2];
printf("%d\n%d", ans1, ans2);
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
void solve() {
long long n;
cin >> n;
vector<long long> v1(n);
vector<long long> v2(n - 1);
vector<long long> v3(n - 2);
for (long long i = 0; i < n; i++) cin >> v1[i];
for (long long i = 0; i < n - 1; i++) cin >> v2[i];
for (long long i = 0; i < n - 2; i++) cin >> v3[i];
unordered_map<long long, long long> m1;
unordered_map<long long, long long> m2;
unordered_map<long long, long long> m3;
for (long long i = 0; i < n; i++) m1[v1[i]]++;
for (long long i = 0; i < n - 1; i++) m2[v2[i]]++;
for (long long i = 0; i < n - 2; i++) m3[v3[i]]++;
for (long long i = 0; i < n; i++) {
if (m1[v1[i]] != m2[v1[i]]) {
cout << v1[i] << "\n";
break;
}
}
for (long long i = 0; i < n - 1; i++) {
if (m2[v2[i]] != m3[v2[i]]) {
cout << v2[i] << "\n";
break;
}
}
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
;
int t = 1;
while (t--) {
solve();
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int n;
long long a[100005], b[100005], c[100005], x, y;
map<long long, int> mp, mp1, mp2;
int main() {
cin >> n;
for (int i = 0; i < n; ++i) {
cin >> a[i];
++mp1[a[i]];
}
for (int i = 0; i < n - 1; ++i) {
cin >> b[i];
++mp[b[i]];
}
for (int i = 0; i < n; ++i) {
if (mp[a[i]] < mp1[a[i]]) {
x = a[i];
break;
}
}
for (int i = 0; i < n - 2; ++i) {
cin >> c[i];
++mp2[c[i]];
}
for (int i = 0; i < n - 1; ++i) {
if (mp2[b[i]] < mp[b[i]]) {
y = b[i];
break;
}
}
cout << x << endl << y;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
struct Errors {
vector<int> first;
vector<int> second;
vector<int> third;
Errors(const int& numberOfFirstErrors)
: first(numberOfFirstErrors),
second(numberOfFirstErrors - 1),
third(numberOfFirstErrors - 2) {}
};
void InputSingleErrorLine(vector<int>& error) {
for (auto& i : error) {
cin >> i;
}
}
Errors Input() {
size_t numberOfErrors;
cin >> numberOfErrors;
Errors error(numberOfErrors);
InputSingleErrorLine(error.first);
InputSingleErrorLine(error.second);
InputSingleErrorLine(error.third);
return move(error);
}
unsigned long long SumErrorsInSingleLine(const vector<int>& errors) {
unsigned long long sum = 0;
for (auto&& i : errors) {
sum += i;
}
return sum;
}
vector<unsigned long long> SaveFixedErros(const Errors& error) {
unsigned long long sumErrorsFirstLine = SumErrorsInSingleLine(error.first);
unsigned long long sumErrorsSecondLine = SumErrorsInSingleLine(error.second);
unsigned long long sumErrorsThirdLine = SumErrorsInSingleLine(error.third);
vector<unsigned long long> fixedErrors = {
sumErrorsFirstLine - sumErrorsSecondLine,
sumErrorsSecondLine - sumErrorsThirdLine};
return move(fixedErrors);
}
void PrintFixedErrors(const vector<unsigned long long>& errors) {
for (auto&& i : errors) {
cout << i << endl;
}
}
int main() {
Errors error = Input();
vector<unsigned long long> fixedErrors = SaveFixedErros(error);
PrintFixedErrors(fixedErrors);
return EXIT_SUCCESS;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n, x, y, z, up1(0), up2(0), up3(0), f1(0), f2(0);
cin >> n;
for (int i = 0; i < n; i++) {
cin >> x;
up1 += x;
}
for (int i = 0; i < n - 1; i++) {
cin >> y;
up2 += y;
}
for (int i = 0; i < n - 2; i++) {
cin >> z;
up3 += z;
}
f1 = up1 - up2;
f2 = up2 - up3;
cout << f1 << "\n" << f2 << "\n";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a = 0, s, b = 0, c = 0;
for (int i = 0; i < n; i++) {
cin >> s;
a += s;
}
for (int i = 0; i < n - 1; i++) {
cin >> s;
b += s;
}
for (int i = 0; i < n - 2; i++) {
cin >> s;
c += s;
}
cout << a - b << "\n" << b - c << "\n";
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int n, a[111111], b[111111], c[111111];
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i = 0; i < n - 1; i++) {
cin >> b[i];
}
for (int i = 0; i < n - 2; i++) {
cin >> c[i];
}
sort(a, a + n);
sort(b, b + n - 1);
sort(c, c + n - 2);
for (int i = 0; i < n; i++) {
if (a[i] != b[i]) {
cout << a[i];
break;
}
}
cout << '\n';
for (int i = 0; i < n - 1; i++) {
if (b[i] != c[i]) {
cout << b[i];
break;
}
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int x;
cin >> x;
int arr[x], ar[x - 1], a[x - 2];
for (int i = 0; i < x; i++) cin >> arr[i];
for (int i = 0; i < x - 1; i++) cin >> ar[i];
for (int i = 0; i < x - 2; i++) cin >> a[i];
sort(arr, arr + x);
sort(ar, ar + x - 1);
sort(a, a + x - 2);
for (int i = 0; i < x; i++) {
if (binary_search(ar + i, ar + x - 1, arr[i]) == 0) {
cout << arr[i] << endl;
break;
}
}
for (int i = 0; i < x - 1; i++) {
if (binary_search(a + i, a + x - 2, ar[i]) == 0) {
cout << ar[i] << endl;
break;
}
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<long long> arr, arr2, arr3;
int temp;
for (int i = 0; i < n; i++) {
cin >> temp;
arr.push_back(temp);
}
for (int i = 0; i < n - 1; i++) {
cin >> temp;
arr2.push_back(temp);
}
for (int i = 0; i < n - 2; i++) {
cin >> temp;
arr3.push_back(temp);
}
sort(arr.begin(), arr.end());
sort(arr2.begin(), arr2.end());
sort(arr3.begin(), arr3.end());
for (int i = 0, j = 0; i < n; i++, j++) {
if (j < n - 1 && arr[i] != arr2[j]) {
cout << arr[i] << endl;
break;
}
if (j == n - 1) cout << arr[i] << endl;
}
for (int i = 0, j = 0; i < n - 1; i++, j++) {
if (j < n - 2 && arr2[i] != arr3[j]) {
cout << arr2[i] << endl;
break;
}
if (j == n - 2) cout << arr2[i] << endl;
}
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int in;
cin >> in;
int s;
long long lsum = 0;
long long sum = 0;
int x = 0;
while (x++ != 3) {
sum = 0;
for (int i = 0; i < in; i++) {
cin >> s;
sum += s;
}
in--;
if (x == 1) {
lsum = sum;
continue;
}
cout << lsum - sum << endl;
lsum = sum;
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int n, i, p, count = 0, count1 = 0;
cin >> n;
vector<long long int> a;
vector<long long int> b;
vector<long long int> c;
for (i = 0; i < n; i++) {
cin >> p;
a.push_back(p);
}
sort(a.begin(), a.end());
for (i = 0; i < n - 1; i++) {
cin >> p;
b.push_back(p);
}
sort(b.begin(), b.end());
for (i = 0; i < n - 2; i++) {
cin >> p;
c.push_back(p);
}
sort(c.begin(), c.end());
for (i = 0; i < n - 1; i++) {
if (a[i] != b[i]) {
count = 1;
cout << a[i] << endl;
break;
}
}
if (count == 0) {
cout << a[n - 1] << endl;
}
for (i = 0; i < n - 2; i++) {
if (b[i] != c[i]) {
count1 = 1;
cout << b[i] << endl;
break;
}
}
if (count1 == 0) {
cout << b[n - 2] << endl;
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a = 0, b = 0, c = 0;
for (int i = 0; i < n; i++) {
int temp;
cin >> temp;
a += temp;
}
for (int i = 0; i < n - 1; i++) {
int temp;
cin >> temp;
b += temp;
}
for (int i = 0; i < n - 2; i++) {
int temp;
cin >> temp;
c += temp;
}
cout << a - b << "\n" << b - c;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int i, j, x, n;
scanf("%d", &n);
vector<int> a, b, c;
for (i = 0; i < n; i++) {
scanf("%d", &x);
a.push_back(x);
}
for (i = 0; i < n - 1; i++) {
scanf("%d", &x);
b.push_back(x);
}
for (i = 0; i < n - 2; i++) {
scanf("%d", &x);
c.push_back(x);
}
sort(a.begin(), a.end());
sort(b.begin(), b.end());
sort(c.begin(), c.end());
x = 0;
for (i = 0; i < n - 1; i++) {
if (a[i] - b[i] != 0) {
printf("%d\n", a[i]);
x++;
break;
}
}
if (x == 0) printf("%d\n", a[n - 1]);
x = 0;
for (i = 0; i < n - 2; i++) {
if (b[i] - c[i] != 0) {
printf("%d\n", b[i]);
x++;
break;
}
}
if (x == 0) printf("%d\n", b[n - 2]);
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
map<int, int> M;
map<int, int> Mfin1;
map<int, int> Mfin2;
int n, x;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> x;
if (M.count(x)) {
M[x]++;
Mfin1[x]++;
Mfin2[x]++;
} else {
M[x] = 1;
Mfin1[x] = 1;
Mfin2[x] = 1;
}
}
for (int i = 0; i < (n - 1); i++) {
cin >> x;
Mfin1[x]--;
}
for (map<int, int>::iterator it = Mfin1.begin(); it != Mfin1.end(); it++) {
if ((it->second)) {
cout << (it->first) << endl;
Mfin2[it->first]--;
}
}
for (int i = 0; i < (n - 2); i++) {
cin >> x;
Mfin2[x]--;
}
for (map<int, int>::iterator it = Mfin2.begin(); it != Mfin2.end(); it++) {
if ((it->second)) cout << (it->first) << endl;
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
map<long, long> s1, s2, s3;
long n, a[100005], b[100005], c[100005], x, first, second;
cin >> n;
for (long i = 0; i < n; i++) {
cin >> a[i];
s1[a[i]]++;
}
for (long i = 0; i < n - 1; i++) {
cin >> b[i];
s2[b[i]]++;
}
for (long i = 0; i < n - 1; i++) {
cin >> c[i];
s3[c[i]]++;
}
for (long i = 0; i < n; i++) {
if (s1[a[i]] != s2[a[i]]) {
first = a[i];
break;
}
}
for (long i = 0; i < n - 1; i++) {
if (s2[b[i]] != s3[b[i]]) {
second = b[i];
break;
}
}
cout << first << endl << second;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int sum(int a[], int size) {
int sum = 0;
for (int i = 0; i < size; i++) {
sum = sum + a[i];
}
return sum;
}
int main() {
int n;
cin >> n;
int a1[n], a2[n - 1], a3[n - 3];
for (int i = 0; i < n; i++) {
cin >> a1[i];
}
for (int i = 0; i < n - 1; i++) {
cin >> a2[i];
}
for (int i = 0; i < n - 2; i++) {
cin >> a3[i];
}
cout << sum(a1, n) - sum(a2, n - 1) << endl
<< sum(a2, n - 1) - sum(a3, n - 2);
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int long long n, element, sum1 = 0, sum2 = 0, sum3 = 0;
vector<int> v1, v2, v3;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> element;
v1.push_back(element);
sum1 += element;
}
for (int i = 0; i < n - 1; i++) {
cin >> element;
v2.push_back(element);
sum2 += element;
}
for (int i = 0; i < n - 2; i++) {
cin >> element;
v3.push_back(element);
sum3 += element;
}
cout << sum1 - sum2 << endl << sum2 - sum3 << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int f = 0, s = 0, t = 0, n;
cin >> n;
long long x;
for (int i = 0; i < n; i++) {
scanf("%d", &x);
f ^= x;
}
s = f;
for (int i = 0; i < n - 1; i++) {
scanf("%d", &x);
s ^= x;
t ^= x;
}
for (int i = 0; i < n - 2; i++) {
scanf("%d", &x);
t ^= x;
}
cout << s << endl << t;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
;
long long n, sum1, sum2, sum3;
sum1 = sum2 = sum3 = 0;
cin >> n;
long long arr1[n], arr2[n], arr3[n];
for (int i = 0; i < n; i++) {
cin >> arr1[i];
sum1 += arr1[i];
}
for (int j = 0; j < n - 1; j++) {
cin >> arr2[j];
sum2 += arr2[j];
}
for (int k = 0; k < n - 2; k++) {
cin >> arr3[k];
sum3 += arr3[k];
}
cout << abs(sum1 - sum2) << '\n';
cout << abs(sum2 - sum3) << '\n';
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> first(n);
vector<int> second(n - 1);
vector<int> third(n - 2);
bool found = false;
for (int i = 0; i < n; i++) {
cin >> first[i];
}
sort(first.begin(), first.end());
for (int i = 0; i < n - 1; i++) {
cin >> second[i];
}
sort(second.begin(), second.end());
for (int i = 0; i < n - 2; i++) {
cin >> third[i];
}
sort(third.begin(), third.end());
for (int i = 0; i < n - 1; i++) {
if (first[i] != second[i]) {
if (second[i] == first[i + 1]) {
cout << first[i] << endl;
found = true;
break;
} else {
cout << second[i] << endl;
found = true;
break;
}
}
}
if (!found) {
cout << first[n - 1] << endl;
}
found = false;
for (int i = 0; i < n - 2; i++) {
if (third[i] != second[i]) {
if (third[i] == second[i + 1]) {
cout << second[i];
found = true;
break;
} else {
cout << third[i];
found = true;
break;
}
}
}
if (!found) {
cout << second[n - 2] << endl;
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:20000000")
string problem_name = "a";
void init() { freopen((problem_name + ".in").c_str(), "rt", stdin); }
int f(char c) {
if (c == '.') return 0;
int flag = 0;
if (isupper(c)) flag = 1;
c = tolower(c);
int res = 0;
if (c == 'q') res = 9;
if (c == 'r') res = 5;
if (c == 'b') res = 3;
if (c == 'n') res = 3;
if (c == 'p') res = 1;
if (c == 'k') res = 0;
if (flag) return res;
return -res;
}
multiset<int> s, s2;
int main() {
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
int t;
scanf("%d", &t);
s.insert(t);
s2.insert(t);
};
for (int i = 0; i < n - 1; i++) {
int t;
scanf("%d", &t);
s.erase(s.find(t));
};
cout << *s.begin();
s2.erase(s2.find(*s.begin()));
cout << endl;
for (int i = 0; i < n - 2; i++) {
int t;
scanf("%d", &t);
s2.erase(s2.find(t));
};
cout << *s2.begin();
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
vector<int> primes;
using ll = long long int;
using dl = double;
bool fk[100000];
ll aarray[100000 + 10];
char magic[1][100000];
const int N = 2e5 + 10;
int main() {
ios_base::sync_with_stdio(false);
string str, ptr;
ll n, a, b, ans = 0, i, A = 0, B, C, D, E, cst, c, cd, d, j, k, x0, t;
vector<ll> v;
vector<ll> ar, ba, ca;
cin >> n;
ll asum = 0, bsum = 0, csum = 0;
for (i = 1; i <= n; i++) {
cin >> a;
asum += a;
}
for (i = 1; i < n; i++) {
cin >> a;
bsum += a;
}
for (i = 1; i < n - 1; i++) {
cin >> a;
csum += a;
}
cout << asum - bsum << " " << bsum - csum << endl;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int k;
unordered_map<int, int> map_1, map_2, map_3;
for (int i = 0; i < N; i++) {
cin >> k;
map_1[k]++;
}
for (int i = 0; i < N - 1; i++) {
cin >> k;
map_2[k]++;
}
for (int i = 0; i < N - 2; i++) {
cin >> k;
map_3[k]++;
}
for (auto pr : map_1) {
int key = pr.first;
if (map_1[key] > map_2[key]) cout << key << endl;
}
for (auto pr : map_2) {
int key = pr.first;
if (map_2[key] > map_3[key]) cout << key << endl;
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
ios::sync_with_stdio(true);
set<int> s;
set<int> s2;
set<int>::iterator it;
int n, aux = 0, error1 = 0, error2 = 0;
long int sum = 0, prevSum = 0, c = 0, aux2, iter;
cin >> n;
iter = n - 2;
while (n >= iter) {
n--;
for (int i = 1; i <= (n + 1); i++) {
cin >> aux;
sum = sum + aux;
}
if (c == 0) {
prevSum = sum;
} else {
aux2 = prevSum - sum;
cout << aux2 << endl;
prevSum = sum;
}
sum = 0;
c++;
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n{0};
unsigned long f{0}, s{0};
cin >> n;
vector<unsigned long> a(n), b(n - 1), c(n - 2);
for (unsigned i{0}; i < a.size(); i++) {
cin >> a[i];
}
for (unsigned i{0}; i < b.size(); i++) {
cin >> b[i];
}
for (unsigned i{0}; i < c.size(); i++) {
cin >> c[i];
}
sort(c.begin(), c.end());
sort(b.begin(), b.end());
sort(a.begin(), a.end());
for (unsigned i{0}; i < b.size(); i++) {
if (a[i] != b[i]) {
f = a[i];
break;
}
}
if (!f) {
f = a[n - 1];
}
for (unsigned i{0}; i < c.size(); i++) {
if (b[i] != c[i]) {
s = b[i];
break;
}
}
if (!s) {
s = b[n - 2];
}
cout << f << '\n' << s << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[n];
int b[n - 1];
int c[n - 2];
int i;
for (i = 0; i < n; i++) {
cin >> a[i];
}
for (i = 0; i < n - 1; i++) {
cin >> b[i];
}
for (i = 0; i < n - 2; i++) {
cin >> c[i];
}
sort(a, a + n);
sort(b, b + (n - 1));
sort(c, c + (n - 2));
int f = 0;
for (i = 0; i < n - 1; i++) {
if (a[i] == b[i]) {
f = 0;
continue;
} else {
f = 1;
cout << a[i] << endl;
break;
}
}
if (f == 0) {
cout << a[n - 1] << endl;
}
int g = 0;
for (i = 0; i < n - 2; i++) {
if (b[i] == c[i]) {
g = 0;
continue;
} else {
g = 1;
cout << b[i] << endl;
break;
}
}
if (g == 0) {
cout << b[n - 2] << endl;
}
}
|
#include <bits/stdc++.h>
using namespace std;
map<int, int> cnta;
map<int, int> cntb;
int a[100000 + 10];
int main() {
int n, b, first = 0, second = 0;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
++cnta[a[i]];
}
for (int i = 1; i <= n - 1; i++) {
cin >> b;
++cntb[b];
}
for (int i = 1; i <= n; i++) {
if (cnta[a[i]] == cntb[a[i]] + 1) {
first = a[i];
break;
}
}
cntb.clear();
for (int i = 1; i <= n - 2; i++) {
cin >> b;
++cntb[b];
}
for (int i = 1; i <= n; i++) {
if (cnta[a[i]] == cntb[a[i]] + 1 && first != a[i]) {
second = a[i];
break;
} else if (cnta[a[i]] == cntb[a[i]] + 2) {
second = first;
break;
}
}
cout << first << endl << second << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int i, j, k, n, m, x, y, T, ans, big, cas, num, len;
bool flag;
map<int, int> a, b;
int main() {
scanf("%d", &n);
a.clear();
b.clear();
int x;
for (i = 1; i <= n; i++) {
scanf("%d", &x);
a[x]++;
b[x]++;
}
for (i = 1; i <= n - 1; i++) {
scanf("%d", &x);
a[x]--;
}
for (i = 1; i <= n - 2; i++) {
scanf("%d", &x);
b[x]--;
}
int fir;
for (map<int, int>::iterator j = a.begin(); j != a.end(); j++) {
if (j->second) {
fir = j->first;
break;
}
}
int sec = -1;
int num = 0;
int ans[100];
for (map<int, int>::iterator j = b.begin(); j != b.end(); j++) {
if (j->second) {
for (i = 1; i <= j->second; i++) ans[num++] = j->first;
}
}
printf("%d\n%d\n", fir, fir == ans[0] ? ans[1] : ans[0]);
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
sort((a).begin(), (a).end());
vector<int> b(n - 1);
for (int i = 0; i < n - 1; ++i) {
cin >> b[i];
}
sort((b).begin(), (b).end());
bool f = 0;
for (int i = 0; i < n - 1; ++i) {
if (b[i] != a[i]) {
cout << a[i] << endl;
f = 1;
break;
}
}
if (!f) {
cout << a[n - 1] << endl;
}
f = 0;
vector<int> c(n - 2);
for (int i = 0; i < n - 2; ++i) {
cin >> c[i];
}
sort((c).begin(), (c).end());
for (int i = 0; i < n - 2; ++i) {
if (c[i] != b[i]) {
cout << b[i] << endl;
f = 1;
break;
}
}
if (!f) cout << b[n - 2] << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
map<char, int> M;
int n, a[100000 * 3 + 100], b[100000 * 3 + 100], c[100000 * 3 + 100];
int main() {
cin >> n;
for (int i = 0; i < n; i++) cin >> a[i];
sort(a, a + n - 1 + 1);
for (int i = 0; i < n - 1; i++) cin >> b[i];
sort(b, b + n - 1);
for (int i = 0; i < n - 2; i++) cin >> c[i];
sort(c, c + n - 1 - 1);
for (int i = 0; i < n; i++)
if (a[i] != b[i]) {
cout << a[i] << endl;
break;
}
for (int i = 0; i < n - 1; i++)
if (c[i] != b[i]) {
cout << b[i] << endl;
break;
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
long long n, a[100001], b[100001 - 1], c[100001 - 2];
void nhap() {
cin >> n;
for (int i = 0; i < n; i++) cin >> a[i];
for (int i = 0; i < n - 1; i++) cin >> b[i];
for (int i = 0; i < n - 2; i++) cin >> c[i];
}
void solve() {
sort(a, a + n);
sort(b, b + n - 1);
sort(c, c + n - 2);
for (int i = 0; i < n; i++) {
if (a[i] != b[i]) {
cout << a[i] << endl;
break;
}
}
for (int i = 0; i < n - 1; i++) {
if (c[i] != b[i]) {
cout << b[i] << endl;
break;
}
}
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
nhap();
solve();
}
|
#include <bits/stdc++.h>
using namespace std;
int main(void) {
int n;
cin >> n;
vector<int> a(n, 0);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
vector<int> b(n - 1, 0);
for (int i = 0; i < n - 1; i++) {
cin >> b[i];
}
vector<int> c(n - 2, 0);
for (int i = 0; i < n - 2; i++) {
cin >> c[i];
}
int firstPass = 0;
for (int i = 0; i < a.size(); i++) {
firstPass ^= a[i];
}
for (int i = 0; i < b.size(); i++) {
firstPass ^= b[i];
}
int secondPass = 0;
for (int i = 0; i < a.size(); i++) {
secondPass ^= a[i];
}
secondPass ^= firstPass;
for (int i = 0; i < c.size(); i++) {
secondPass ^= c[i];
}
cout << firstPass << endl << secondPass;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1);
int CNT_ = 0;
const int mod = 1e9 + 7;
const int maxn = 2e5 + 100;
string current[maxn], initial[maxn];
int main() {
ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
unordered_map<int, int> f1, f2;
int n;
cin >> n;
for (int i = 0, x; i < n; ++i) {
cin >> x;
f1[x]++;
}
n--;
for (int i = 0, x; i < n; ++i) {
cin >> x;
f2[x]++;
if (--f1[x] == 0) f1.erase(x);
}
cout << f1.begin()->first << '\n';
n--;
for (int i = 0, x; i < n; ++i) {
cin >> x;
if (--f2[x] == 0) f2.erase(x);
}
cout << f2.begin()->first << '\n';
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int i, n;
scanf("%d", &n);
int s1 = 0, s2 = 0, s3 = 0;
int* arr = new int[n];
int* arr2 = new int[n - 1];
int* arr3 = new int[n - 2];
for (i = 0; i < n; i++) {
scanf("%d", &arr[i]);
s1 += arr[i];
}
for (i = 0; i < n - 1; i++) {
scanf("%d", &arr2[i]);
s2 += arr2[i];
}
for (i = 0; i < n - 2; i++) {
scanf("%d", &arr3[i]);
s3 += arr3[i];
}
printf("%d\n", s1 - s2);
printf("%d\n", s2 - s3);
}
|
#include <bits/stdc++.h>
using namespace std;
long long n, a, b, c, f, in1, in2, in3;
int main() {
cin >> n;
for (long long i = 0; i < n; i++) {
cin >> in1;
a += in1;
}
for (long long i = 0; i < n - 1; i++) {
cin >> in2;
b += in2;
}
for (long long i = 0; i < n - 2; i++) {
cin >> in3;
c += in3;
}
cout << a - b << endl;
cout << b - c << endl;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, i, j, m, x, y, z, k, l;
int a[100001], b[100001], c[100001];
while (cin >> n) {
for (i = 0; i < n; i++) {
cin >> a[i];
}
for (i = 0; i < n - 1; i++) {
cin >> b[i];
}
for (i = 0; i < n - 2; i++) {
cin >> c[i];
}
sort(a, a + n);
sort(b, b + n - 1);
sort(c, c + n - 2);
k = l = 1;
for (i = 0; i < n - 1; i++) {
if (a[i] != b[i]) {
k = 0;
cout << a[i] << endl;
break;
}
}
if (k) cout << a[i] << endl;
for (i = 0; i < n - 2; i++) {
if (b[i] != c[i]) {
l = 0;
cout << b[i] << endl;
break;
}
}
if (l) cout << b[i] << endl;
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
long long x, s1 = 0, s2 = 0;
for (int i = 0; i < n; i++) {
cin >> x;
s1 += x;
}
for (int i = 0; i < n - 1; i++) {
cin >> x;
s2 += x;
}
cout << s1 - s2 << endl;
s1 = 0;
for (int i = 0; i < n - 2; i++) {
cin >> x;
s1 += x;
}
cout << s2 - s1 << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
map<long long, long long> error1, error2;
long long n, a;
cin >> n;
for (int j = 1; j <= 3; j++) {
for (long long i = 1; i <= n; i++) {
if (j == 1) {
cin >> a;
if (error1.find(a) == error1.end())
error1.insert(pair<long long, long long>(a, 1));
else
error1[a]++;
}
if (j == 2) {
cin >> a;
if (error2.find(a) == error2.end())
error2.insert(pair<long long, long long>(a, 1));
else
error2[a]++;
if (error1.find(a) != error1.end())
if (error1[a] == 1)
error1.erase(a);
else
error1[a]--;
}
if (j == 3) {
cin >> a;
if (error2.find(a) != error2.end())
if (error2[a] == 1)
error2.erase(a);
else
error2[a]--;
}
}
n--;
}
for (auto i = error1.begin(); i != error1.end(); i++) {
if (i->second != 0) cout << i->first << " ";
}
for (auto i = error2.begin(); i != error2.end(); i++) {
if (i->second != 0) cout << i->first << " ";
}
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, x;
cin >> n;
int arr[n + 1];
map<int, int> mp1, mp2;
for (int i = 0; i < n; i++) {
cin >> x;
mp1[x]++;
}
for (int i = 0; i < n - 1; i++) {
cin >> x;
mp2[x]++;
}
for (auto itr = mp1.begin(); itr != mp1.end(); itr++) {
int a = itr->first;
if (mp1[a] - mp2[a] > 0) {
cout << a << endl;
mp2[a]++;
mp1[a]--;
} else
continue;
}
mp2.clear();
for (int i = 0; i < n - 2; i++) {
cin >> x;
mp2[x]++;
}
for (auto itr = mp1.begin(); itr != mp1.end(); itr++) {
int a = itr->first;
if (mp1[a] - mp2[a] > 0) {
cout << a << endl;
} else
continue;
}
}
|
#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
if (a == 0) return b;
return gcd(b % a, a);
}
template <typename T>
void read(T &x) {
register T c = getchar();
x = 0;
int t = 0;
if (c == '-') t = 1, c = getchar();
for (; (c < 48 || c > 57); c = getchar())
;
for (; c > 47 && c < 58; c = getchar()) {
x = (x << 1) + (x << 3) + c - 48;
}
if (t) x = -x;
}
template <typename T>
T pow(T x, T y) {
T ans = 1;
while (y > 0) {
if (y % 2 == 1) ans = (ans * x) % 1000000007;
y /= 2;
x = (x * x) % 1000000007;
}
return ans;
}
template <typename T>
long long int roundp(T x) {
long long int ans = x;
if (x - floor(x) <= 0.001)
ans = floor(x);
else if (ceil(x) - x <= 0.001)
ans = ceil(x);
return ans;
}
int main() {
int n, x;
cin >> n;
map<int, int> m1, m2;
for (long long(i) = (0); i < (n); i++) {
cin >> x;
++m1[x];
}
for (long long(i) = (0); i < (n - 1); i++) {
cin >> x;
--m1[x];
++m2[x];
}
for (long long(i) = (0); i < (n - 2); i++) {
cin >> x;
--m2[x];
}
for (auto x : m1) {
if (x.second > 0) {
cout << x.first << '\n';
break;
}
}
for (auto x : m2) {
if (x.second > 0) {
cout << x.first << '\n';
break;
}
}
}
|
#include <bits/stdc++.h>
int a[999999];
int b[999999];
int c[999999];
int main() {
int n, i, j, k, sum1, sum2, sum3;
while (scanf("%d", &n) != EOF) {
sum1 = 0;
sum2 = 0;
sum3 = 0;
for (i = 1; i <= n; i++) {
scanf("%d", &a[i]);
}
for (i = 1; i <= n; i++) {
sum1 += a[i];
}
for (j = 1; j <= n - 1; j++) {
scanf("%d", &b[j]);
}
for (j = 1; j <= n - 1; j++) {
sum2 += b[j];
}
for (k = 1; k <= n - 2; k++) {
scanf("%d", &c[k]);
}
for (k = 1; k <= n - 2; k++) {
sum3 += c[k];
}
printf("%d\n%d\n", sum1 - sum2, sum2 - sum3);
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, i, x, achou;
scanf("%d", &n);
vector<int> v1;
vector<int> v2;
vector<int> v3;
for (i = 0; i < n; i++) {
scanf("%d", &x);
v1.push_back(x);
}
sort(v1.begin(), v1.end());
for (i = 0; i < n - 1; i++) {
scanf("%d", &x);
v2.push_back(x);
}
sort(v2.begin(), v2.end());
achou = 0;
for (i = 0; i < n && !achou; i++) {
if (i == n - 1 || v1.at(i) != v2.at(i)) {
printf("%d\n", v1.at(i));
achou = 1;
}
}
for (i = 0; i < n - 2; i++) {
scanf("%d", &x);
v3.push_back(x);
}
sort(v3.begin(), v3.end());
achou = 0;
for (i = 0; i < n - 1 && !achou; i++) {
if (i == n - 2 || v2.at(i) != v3.at(i)) {
printf("%d\n", v2.at(i));
achou = 1;
}
}
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
;
int t;
cin >> t;
list<long int> x, y, z;
for (int i = 0; i < t; i++) {
long int in;
cin >> in;
x.push_back(in);
}
x.sort();
for (int i = 0; i < t - 1; i++) {
long int in;
cin >> in;
y.push_back(in);
}
y.sort();
list<long int>::iterator i1 = x.begin(), i2 = y.begin();
while (*i1 == *i2 && i2 != y.end()) i1++, i2++;
cout << *i1 << endl;
for (int i = 0; i < t - 2; i++) {
long int in;
cin >> in;
z.push_back(in);
}
z.sort();
i1 = y.begin(), i2 = z.begin();
while (*i1 == *i2 && i2 != z.end()) i1++, i2++;
cout << *i1 << endl;
}
|
#include <bits/stdc++.h>
using namespace std;
long long a[3];
int main() {
int n;
cin >> n;
int s = 0, s1 = 0, s2 = 0;
for (int i = 0; i < n; i++) {
int a;
cin >> a;
s += a;
}
for (int i = 0; i < n - 1; i++) {
int a;
cin >> a;
s1 += a;
}
for (int i = 0; i < n - 2; i++) {
int a;
cin >> a;
s2 += a;
}
cout << s - s1 << endl << s1 - s2;
}
|
#include <bits/stdc++.h>
using namespace std;
void file() {
freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);
}
const int MAX = 1e5 + 7, INF = (1 << 30);
int main() {
int n, x, f;
scanf("%d", &n);
unordered_map<long long, int> m, m1;
for (int i = 0; i < n; ++i) scanf("%d", &x), ++m[x];
for (int i = 0; i < n - 1; ++i) {
scanf("%d", &x), ++m1[x], --m[x];
}
for (auto k : m)
if (m[k.first] > 0) {
printf("%d\n", k.first);
break;
}
for (int i = 0; i < n - 2; ++i) scanf("%d", &x), --m1[x];
for (auto k : m)
if (m1[k.first] > 0) {
printf("%d\n", k.first);
break;
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n, i, x = 0, y;
cin >> n;
vector<long long> v1, v2, v3;
for (i = 0; i < n; i++) {
cin >> x;
v1.push_back(x);
}
for (i = 0; i < n - 1; i++) {
cin >> y;
v2.push_back(y);
}
for (i = 0; i < n - 2; i++) {
cin >> x;
v3.push_back(x);
}
sort(v1.begin(), v1.end());
sort(v2.begin(), v2.end());
sort(v3.begin(), v3.end());
x = 0;
for (i = 0; i < v2.size(); i++) {
if (v1[i] != v2[i]) {
cout << v1[i] << endl;
x = 1;
break;
}
}
if (x == 0) {
cout << v1[i] << endl;
}
x = 0;
for (i = 0; i < v3.size(); i++) {
if (v2[i] != v3[i]) {
cout << v2[i] << endl;
x = 1;
break;
}
}
if (x == 0) {
cout << v2[i] << endl;
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a = 0, b = 0, c = 0;
int t;
for (int i = 0; i < n; i++) {
cin >> t;
a ^= t;
}
for (int i = 0; i < n - 1; i++) {
cin >> t;
b ^= t;
}
for (int i = 0; i < n - 2; i++) {
cin >> t;
c ^= t;
}
cout << (a ^ b) << endl;
cout << (b ^ c) << endl;
}
|
#include <bits/stdc++.h>
using namespace std;
int a1[100010], a2[100010], a3[100010];
int n;
int main() {
int i, j;
while (~scanf("%d", &n)) {
for (i = 0; i < n; i++) {
scanf("%d", &a1[i]);
}
for (i = 0; i < n - 1; i++) {
scanf("%d", &a2[i]);
}
for (i = 0; i < n - 2; i++) {
scanf("%d", &a3[i]);
}
sort(a1, a1 + n);
sort(a2, a2 + n - 1);
sort(a3, a3 + n - 2);
for (i = 0; i < n - 1; i++) {
if (a1[i] != a2[i]) {
printf("%d\n", a1[i]);
break;
}
}
if (i == n - 1) {
printf("%d\n", a1[i]);
}
for (i = 0; i < n - 2; i++) {
if (a2[i] != a3[i]) {
printf("%d\n", a2[i]);
break;
}
}
if (i == n - 2) {
printf("%d\n", a2[i]);
}
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
scanf("%d", &n);
int x = n - 1, y = n - 2, i;
long long int a[n], b[x], c[y];
for (i = 0; i < n; i++) {
scanf("%lld", &a[i]);
}
for (i = 0; i < x; i++) {
scanf("%lld", &b[i]);
}
for (i = 0; i < y; i++) {
scanf("%lld", &c[i]);
}
sort(a, a + n);
sort(b, b + x);
sort(c, c + y);
long long int j, r1, r2, flag = 0;
for (i = 0; i < n; i++) {
flag = 0;
for (j = i; j < x; j++) {
if (b[j] == a[i]) {
flag = 1;
break;
}
}
if (flag == 0) {
r1 = a[i];
break;
}
}
for (i = 0; i < x; i++) {
flag = 0;
for (j = i; j < y; j++) {
if (c[j] == b[i]) {
flag = 1;
break;
}
}
if (flag == 0) {
r2 = b[i];
break;
}
}
printf("%lld\n%lld", r1, r2);
}
|
#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e5 + 10;
long long freq1[maxn];
long long freq2[maxn];
long long freq3[maxn];
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long n;
cin >> n;
for (long long j = 1; j <= n; j++) {
cin >> freq1[j];
}
for (long long j = 1; j <= n - 1; j++) {
cin >> freq2[j];
}
for (long long j = 1; j <= n - 2; j++) {
cin >> freq3[j];
}
sort(freq1 + 1, freq1 + n + 1);
sort(freq2 + 1, freq2 + n);
sort(freq3 + 1, freq3 + n - 1);
long long flag = 1, flag1 = 1;
for (long long j = 1; j <= n; j++) {
if (freq1[j] != freq2[j]) {
cout << freq1[j] << "\n";
break;
}
}
for (long long j = 1; j <= n - 1; j++) {
if (freq2[j] != freq3[j]) {
cout << freq2[j] << "\n";
break;
}
}
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, d, k;
cin >> n;
int a[n], b[n - 1], c[n - 2];
for (int i = 0; i < n; i++) {
cin >> a[i];
}
sort(a, a + n);
for (int i = 0; i < (n - 1); i++) {
cin >> b[i];
}
sort(b, b + n - 1);
for (int i = 0; i < n; i++) {
if (a[i] != b[i]) {
k = a[i];
break;
}
}
for (int i = 0; i < (n - 2); i++) {
cin >> c[i];
}
sort(c, c + n - 2);
for (int i = 0; i < n - 1; i++) {
if (b[i] != c[i]) {
d = b[i];
break;
}
}
cout << k << endl << d << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
template <class T>
void print(T &x) {
for (auto &it : x) {
cout << it << " ";
}
cout << "\n";
};
void solve();
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
solve();
}
void solve() {
int n;
cin >> n;
multiset<int> st1, st2;
for (int i = 0; i < (n); ++i) {
int tmp;
cin >> tmp;
st1.insert(tmp);
}
for (int i = 0; i < (n - 1); ++i) {
int tmp;
cin >> tmp;
st2.insert(tmp);
auto it = st1.lower_bound(tmp);
st1.erase(it);
}
print(st1);
for (int i = 0; i < (n - 2); ++i) {
int tmp;
cin >> tmp;
auto it = st2.lower_bound(tmp);
st2.erase(it);
}
print(st2);
}
|
#include <bits/stdc++.h>
int main(int argc, const char *agrv[]) {
int n;
long long last, sum, input;
scanf("%d", &n);
sum = 0;
for (int i = 1; i <= n; i++) {
scanf("%lld", &input);
sum += input;
}
last = sum;
sum = 0;
for (int i = 1; i < n; i++) {
scanf("%lld", &input);
sum += input;
}
printf("%lld\n", last - sum);
last = sum;
sum = 0;
for (int i = 1; i < n - 1; i++) {
scanf("%lld", &input);
sum += input;
}
printf("%lld\n", last - sum);
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
int m, n;
int a[3];
cin >> n;
for (int i = 0; i < 3; i++) {
a[i] = 0;
for (int j = 0; j < n - i; j++) {
cin >> m;
a[i] = a[i] + m;
}
}
cout << a[0] - a[1] << endl;
cout << a[1] - a[2] << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int t, a = 0, b = 0, c = 0;
int arr[100000], arr1[100000], arr2[100000], arr3[100000], arr4[100000];
cin >> t;
for (int i = 0; i < t; i++) {
cin >> arr1[i];
}
sort(arr1, arr1 + t);
for (int i = 0; i < t - 1; i++) {
cin >> arr2[i];
}
sort(arr2, arr2 + (t - 1));
for (int i = 0; i < t - 2; i++) {
cin >> arr3[i];
}
sort(arr3, arr3 + (t - 2));
for (int i = 0; i < t; i++) {
if (arr1[i] != arr2[i]) {
cout << arr1[i] << endl;
break;
}
}
for (int i = 0; i < t - 1; i++) {
if (arr2[i] != arr3[i]) {
cout << arr2[i] << endl;
break;
}
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, a[100001], b[100001], c[100001], i;
cin >> n;
for (i = 0; i < n; i++) cin >> a[i];
for (i = 0; i < n - 1; i++) cin >> b[i];
for (i = 0; i < n - 2; i++) cin >> c[i];
int sm_a = 0, sm_b = 0, sm_c = 0;
for (i = 0; i < n; i++) sm_a += a[i];
for (i = 0; i < n - 1; i++) sm_b += b[i];
for (i = 0; i < n - 2; i++) sm_c += c[i];
cout << sm_a - sm_b << " " << sm_b - sm_c;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int i, n, t;
cin >> n;
vector<int> v1;
vector<int> v2;
vector<int> v3;
vector<int> diff;
vector<int> diff1;
for (i = 0; i < n; i++) {
cin >> t;
v1.push_back(t);
}
for (i = 0; i < n - 1; i++) {
cin >> t;
v2.push_back(t);
}
for (i = 0; i < n - 2; i++) {
cin >> t;
v3.push_back(t);
}
sort(v1.begin(), v1.end());
sort(v2.begin(), v2.end());
sort(v3.begin(), v3.end());
i = 0;
set_difference(v1.begin(), v1.end(), v2.begin(), v2.end(),
inserter(diff, diff.begin()));
cout << diff[0] << endl;
set_difference(v2.begin(), v2.end(), v3.begin(), v3.end(),
inserter(diff1, diff1.begin()));
cout << diff1[0];
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int n, a[100010], x1, x2, b[100010];
int main() {
scanf("%d", &n);
memset(a, 0x7fffffff, sizeof(a));
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
sort(a, a + n);
memset(b, 0x7fffffff, sizeof(b));
for (int i = 0; i < n - 1; i++) {
scanf("%d", &b[i]);
}
sort(b, b + n - 1);
for (int i = 0; i < n; i++) {
if (a[i] != b[i]) {
x1 = a[i];
break;
}
}
memset(a, 0x7fffffff, sizeof(a));
for (int i = 0; i < n - 2; i++) scanf("%d", &a[i]);
sort(a, a + n - 2);
for (int i = 0; i < n - 1; i++) {
if (a[i] != b[i]) {
x2 = b[i];
break;
}
}
printf("%d\n%d\n", x1, x2);
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
long long a;
map<long long, int> mp[3];
cin >> n;
for (int j = 0; j < 3; j++) {
for (int(i) = 0; (i) < (n - j); (i)++) {
cin >> a;
mp[j][a]++;
}
}
for (int(i) = 0; (i) < (2); (i)++) {
for (auto j : mp[i]) {
if (mp[i][j.first] != mp[i + 1][j.first]) {
cout << j.first << endl;
break;
}
}
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[n], b[n - 1], c[n - 2], sum1 = 0, sum2 = 0, sum3 = 0;
for (int i = 0; i < n; i++) cin >> a[i], sum1 += a[i];
for (int i = 0; i < n - 1; i++) cin >> b[i], sum2 += b[i];
for (int i = 0; i < n - 2; i++) cin >> c[i], sum3 += c[i];
cout << sum1 - sum2 << "\n" << sum2 - sum3 << "\n";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
;
int n;
cin >> n;
int ans = 0, res = 0;
for (int i = 0; i < n; ++i) {
int x;
cin >> x;
ans ^= x;
}
for (int i = 0; i < n - 1; ++i) {
int x;
cin >> x;
ans ^= x, res ^= x;
}
cout << ans << "\n";
for (int i = 0; i < n - 2; ++i) {
int x;
cin >> x;
res ^= x;
}
cout << res << "\n";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long unsigned n, x = 0, y = 0, z = 0, a, b, c;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a;
x = x + a;
}
for (int i = 0; i < n - 1; i++) {
cin >> b;
y = y + b;
}
for (int i = 0; i < n - 2; i++) {
cin >> c;
z = z + c;
}
cout << x - y << endl;
cout << y - z;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c = 0, s = 0;
cin >> a;
for (int i = 1; i <= a; i++) {
cin >> b;
c = c + b;
}
for (int i = 1; i <= a - 1; i++) {
cin >> b;
s = s + b;
}
cout << c - s << endl;
c = 0;
for (int i = 1; i < a - 1; i++) {
cin >> b;
c = c + b;
}
cout << s - c << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int a[100000] = {};
int main() {
long long b = 0, c = 0, d = 0;
int n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
b += a[i];
}
for (int i = 0; i < n - 1; i++) {
cin >> a[i];
c += a[i];
}
int x = b - c;
for (int i = 0; i < n - 2; i++) {
cin >> a[i];
d += a[i];
}
int y = c - d;
cout << x << '\n' << y;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
const int size = n;
int arr[size], arr1[size], arr2[size];
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
sort(arr, arr + n);
for (int i = 0; i < n - 1; i++) {
cin >> arr1[i];
}
sort(arr1, arr1 + (n - 1));
for (int i = 0; i < n - 2; i++) {
cin >> arr2[i];
}
sort(arr2, arr2 + (n - 2));
for (int i = 0; i < n; i++) {
if (arr[i] != arr1[i]) {
cout << arr[i] << endl;
break;
}
}
for (int i = 0; i < n; i++) {
if (arr1[i] != arr2[i]) {
cout << arr1[i] << endl;
break;
}
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a = 0, b = 0, c = 0;
int r;
for (int i = 0; i < n; ++i) {
cin >> r;
a += r;
}
for (int i = 0; i < n - 1; ++i) {
cin >> r;
b += r;
}
for (int i = 0; i < n - 2; ++i) {
cin >> r;
c += r;
}
cout << (a - b) << '\n' << (b - c) << '\n';
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
long long n, sum1 = 0, sum2 = 0, sum3 = 0;
cin >> n;
for (int i = 0; i < n; ++i) {
long long e;
cin >> e;
sum1 += e;
}
for (int i = 0; i < n - 1; ++i) {
long long e;
cin >> e;
sum2 += e;
}
for (int i = 0; i < n - 2; ++i) {
long long e;
cin >> e;
sum3 += e;
}
cout << sum1 - sum2 << endl << sum2 - sum3 << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
int a[n], b[n - 1], c[n - 2];
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i = 0; i < n - 1; i++) {
cin >> b[i];
}
for (int i = 0; i < n - 2; i++) {
cin >> c[i];
}
sort(a, a + n);
sort(b, b + n - 1);
sort(c, c + n - 2);
int i = 0, j = 0, k = 0;
int p, q;
while (i < n) {
if (a[i] == b[j]) {
if (b[j] == c[k]) {
i++;
j++;
k++;
} else {
q = a[i];
i++;
j++;
}
} else {
p = a[i];
i++;
}
}
cout << p << "\n" << q << "\n";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, t;
cin >> n;
int a = 0, b = 0, c = 0;
for (int i = 0; i < n; i++) {
cin >> t;
a += t;
}
for (int i = 0; i < n - 1; i++) {
cin >> t;
b += t;
}
for (int i = 0; i < n - 2; i++) {
cin >> t;
c += t;
}
cout << a - b << '\n';
cout << b - c << '\n';
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n), b(n - 1), c(n - 2);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
sort(a.begin(), a.end());
for (int i = 0; i < n - 1; i++) {
cin >> b[i];
}
sort(b.begin(), b.end());
for (int i = 0; i < n - 2; i++) {
cin >> c[i];
}
sort(c.begin(), c.end());
int u = 0;
while (u < n - 1 && a[u] == b[u]) {
u++;
}
cout << a[u] << endl;
u = 0;
while (u < n - 2 && b[u] == c[u]) {
u++;
}
cout << b[u];
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
unordered_map<int, int> m1;
for (int i = 0; i < n; i++) {
int x;
cin >> x;
m1[x]++;
}
unordered_map<int, int> m2;
for (int i = 0; i < n - 1; i++) {
int x;
cin >> x;
m1[x]--;
m2[x]++;
if (m1[x] == 0) m1.erase(x);
}
auto itr = m1.begin();
cout << itr->first << endl;
for (int i = 0; i < n - 2; i++) {
int x;
cin >> x;
m2[x]--;
if (m2[x] == 0) m2.erase(x);
}
itr = m2.begin();
cout << itr->first << endl;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[n], b[n - 1], c[n - 2];
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i = 0; i < n - 1; i++) {
cin >> b[i];
}
for (int i = 0; i < n - 2; i++) {
cin >> c[i];
}
sort(a, a + n);
sort(b, b + n - 1);
sort(c, c + n - 2);
int f = 0;
for (int i = 0; i < n; i++) {
if (a[i] != b[i]) {
cout << a[i] << '\n';
break;
}
}
for (int i = 0; i < n - 1; i++) {
if (b[i] != c[i]) {
cout << b[i];
return 0;
}
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n, s, a = 0, b = 0, c = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> s;
a += s;
}
for (int i = 0; i < n - 1; i++) {
cin >> s;
b += s;
}
for (int i = 0; i < n - 2; i++) {
cin >> s;
c += s;
}
cout << a - b << endl << b - c << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int n;
cin >> n;
long long int a[n], b[n - 1], c[n - 2];
unordered_map<long long int, long long int> hash1;
unordered_map<long long int, long long int> hash2;
unordered_map<long long int, long long int> hash3;
for (long long int i = 0; i < n; i++) {
cin >> a[i];
hash1[a[i]]++;
}
for (long long int i = 0; i < n - 1; i++) {
cin >> b[i];
hash2[b[i]]++;
}
for (long long int i = 0; i < n - 2; i++) {
cin >> c[i];
hash3[c[i]]++;
}
for (long long int i = 0; i < n; i++) {
if (hash2[a[i]] != hash1[a[i]]) {
cout << a[i] << endl;
break;
}
}
for (long long int i = 0; i < n - 1; i++) {
if (hash3[b[i]] != hash2[b[i]]) {
cout << b[i] << endl;
break;
}
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, i, k, mx = -1;
vector<int> a, b, c;
cin >> n;
for (i = 0; i < n; i++) {
cin >> k;
a.push_back(k);
}
sort(a.begin(), a.end());
for (i = 0; i < n - 1; i++) {
cin >> k;
b.push_back(k);
}
sort(b.begin(), b.end());
for (i = 0; i < n - 1; i++) {
if (b[i] != a[i]) {
cout << a[i] << endl;
mx = 1;
break;
}
}
if (mx == -1) cout << a[n - 1] << endl;
for (i = 0; i < n - 2; i++) {
cin >> k;
c.push_back(k);
}
mx = -1;
sort(c.begin(), c.end());
for (i = 0; i < n - 2; i++) {
if (c[i] != b[i]) {
cout << b[i] << endl;
mx = 1;
break;
}
}
if (mx == -1) cout << b[n - 2] << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int mx = (int)1e6 * -1;
int mn = (int)1e9;
void go_fast() {
ios_base ::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
}
bool ok;
int a[280000], p[111111], b[111111];
string s;
long long cnt, ans, res, sum;
int main() {
go_fast();
int n;
cin >> n;
for (int i = 1; i <= n; ++i) {
cin >> a[i];
sum += a[i];
}
for (int i = 1; i <= n - 1; ++i) {
cin >> p[i];
cnt += p[i];
}
for (int i = 1; i <= n - 2; ++i) {
cin >> b[i];
ans += b[i];
}
cout << sum - cnt << "\n" << cnt - ans;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[n], b[n], c[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i = 0; i < n - 1; i++) {
cin >> b[i];
}
for (int i = 0; i < n - 2; i++) {
cin >> c[i];
}
sort(a, a + n);
sort(b, b + (n - 1));
sort(c, c + (n - 2));
for (int i = 0; i < n; i++) {
if (a[i] != b[i]) {
cout << a[i] << "\n";
break;
}
}
for (int i = 0; i < n - 1; i++) {
if (b[i] != c[i]) {
cout << b[i] << "\n";
break;
}
}
}
|
#include <bits/stdc++.h>
using namespace std;
int ar[3];
int main() {
int a, b;
cin >> a;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < a - i; j++) {
cin >> b;
ar[i] += b;
}
}
cout << ar[0] - ar[1] << endl << ar[1] - ar[2];
cout << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, c, j, err_1 = 0, err_2 = 0;
scanf("%i", &n);
for (j = 0; j < n; j++) {
scanf("%i", &c);
err_1 += c;
}
for (j = 0; j < n - 1; j++) {
scanf("%i", &c);
err_2 += c;
}
err_1 -= err_2;
for (j = 0; j < n - 2; j++) {
scanf("%i", &c);
err_2 -= c;
}
printf("%i\n%i", err_1, err_2);
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, i, sum1 = 0, sum2 = 0, sum3 = 0;
cin >> n;
int a[n], b[n - 1], c[n - 2];
for (i = 0; i < n; i++) {
cin >> a[i];
sum1 += a[i];
}
cout << endl;
for (i = 0; i < n - 1; i++) {
cin >> b[i];
sum2 += b[i];
}
cout << endl;
for (i = 0; i < n - 2; i++) {
cin >> c[i];
sum3 += c[i];
}
cout << endl;
cout << sum1 - sum2 << endl;
cout << sum2 - sum3 << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
unsigned long long bpow(unsigned long long a, int n) {
return n ? n & 1 ? bpow(a, n - 1) * a : bpow(a * a, n >> 1) : 1;
}
unsigned long long prod_range_tree(int l, int r) {
if (l == r) return l;
if (r - l == 1) return (unsigned long long)r * l;
int m = (l + r) / 2;
return prod_range_tree(l, m) * prod_range_tree(m + 1, r);
}
unsigned long long fact(int n) {
if (n < 0) return 0;
if (n == 0) return 1;
if (n == 1 || n == 2) return n;
return prod_range_tree(2, n);
}
bool is_upper(char c) { return (c >= 65 && c <= 90); }
bool is_lower(char c) { return (c >= 97 && c <= 122); }
int get_digit(long long num, int len, int index) {
return num / bpow(10, len - index - 1) % 10;
}
long long digit_sum(long long num) {
long long dig_sum = 0;
while (num > 0) {
dig_sum += num % 10;
num /= 10;
}
return dig_sum;
}
const int INF = 1000000000;
long long n, m, k, p, q, sum = 0, cnt = 0;
long long mx = INT64_MIN;
long long mn = INT64_MAX;
bool flag = 0;
vector<long long> v;
string s = "", s1, s2;
void solve() {
cin >> n;
long long temp;
m = 0;
k = 0;
p = 0;
for (long long i = 0; i < n; ++i) {
cin >> temp;
m += temp;
}
for (long long i = 0; i < n - 1; ++i) {
cin >> temp;
k += temp;
}
cout << m - k << endl;
for (long long i = 0; i < n - 2; ++i) {
cin >> temp;
p += temp;
}
cout << k - p;
}
int main() {
solve();
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int first[100005];
int second[100005];
int third[100005];
int main() {
int n;
int j;
cin >> n;
for (int i = 0; i < n; ++i) {
cin >> first[i];
}
for (int i = 0; i < n - 1; ++i) {
cin >> second[i];
}
for (int i = 0; i < n - 2; ++i) {
cin >> third[i];
}
sort(first, first + n);
sort(second, second + n - 1);
sort(third, third + n - 2);
for (j = 0; j < n - 1; ++j) {
if (first[j] != second[j]) {
cout << first[j] << endl;
break;
}
}
if (j == n - 1) {
cout << first[j] << endl;
}
for (j = 0; j < n - 2; ++j) {
if (third[j] != second[j]) {
cout << second[j] << endl;
break;
}
}
if (j == n - 2) {
cout << second[j] << endl;
}
return 0;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.