Advertisement
ShRooK_MoHameD

MyCode

Dec 12th, 2022
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. void solve()
  2. {
  3.   ll n;
  4.   cin>>n;
  5.   vector<ll>v1(n),v2(n-1),v3(n-2);
  6.   cin(v1);
  7.   cin(v2);
  8.   cin(v3);
  9.   sort(all(v1));
  10.   sort(all(v2));
  11.   sort(all(v3));
  12.  
  13.   for(int i=0 ; i<n ; i++)
  14.   {
  15.     if(i==n-1){cout<<v1[n-1];break;}
  16.     if(v1[i]!=v2[i])
  17.     {
  18.       cout<<v1[i]<<nl;
  19.       break;
  20.     }
  21.   }
  22.   for(int i=0 ; i<n-1 ; i++)
  23.   {
  24.     if(i==n-2){cout<<v2[n-2];break;}
  25.     if(v2[i]!=v3[i])
  26.     {
  27.       cout<<v2[i]<<nl;
  28.       break;
  29.     }
  30.   }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement