fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define ms(s,n) memset(s,n,sizeof(s))
  5. #define all(a) a.begin(),a.end()
  6. #define present(t, x) (t.find(x) != t.end())
  7. #define sz(a) int((a).size())
  8. #define FOR(i, a, b) for (int i = (a); i < (b); ++i)
  9. #define FORd(i, a, b) for (int i = (a) - 1; i >= (b); --i)
  10. #define pb push_back
  11. #define pf push_front
  12. #define fi first
  13. #define se second
  14. #define mp make_pair
  15.  
  16. typedef long long ll;
  17. typedef unsigned long long ull;
  18. typedef long double ld;
  19. typedef pair<int,int> pi;
  20. typedef vector<int> vi;
  21. typedef vector<pi> vii;
  22.  
  23. const int MOD = (int) 1e9+7;
  24. const int INF = (int) 1e9+1;
  25. inline ll gcd(ll a,ll b){ll r;while(b){r=a%b;a=b;b=r;}return a;}
  26. inline ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
  27.  
  28.  
  29. void FileIO(){
  30. freopen("input.txt","r", stdin);
  31. freopen("output.txt","w",stdout);
  32. }
  33.  
  34. int main(){
  35. //FileIO();
  36. ios::sync_with_stdio(false);
  37. cin.tie(nullptr);
  38. cout.tie(nullptr);
  39. int n;cin>>n;
  40. int a[n],b[n-1],c[n-2];
  41. map<int,int> m,m3;
  42. FOR(i,0,n){
  43. cin>>a[i];
  44. m[a[i]]++;
  45. }
  46. map<int,int> m2;
  47. FOR(i,0,n-1){
  48. cin>>b[i];
  49. m2[b[i]]++;
  50. }
  51. FOR(i,0,n){
  52. if(m[a[i]]!=m2[a[i]]){
  53. cout<<a[i]<<"\n";break;
  54. }
  55. }
  56. FOR(i,0,n-2){
  57. cin>>c[i];
  58. m3[c[i]]++;
  59. }
  60. FOR(i,0,n-1){
  61. if(m2[b[i]]!=m3[b[i]]){
  62. cout<<b[i]<<"\n";break;
  63. }
  64. }
  65. }
Success #stdin #stdout 0.01s 5512KB
stdin
Standard input is empty
stdout
0
0