fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int t,n,i,j,k,g,h,q,st,en,mi;
  7. vector<int> a,b,c;
  8. cin>>n;
  9. for(i=0;i<n;i++)
  10. {
  11. cin>>g;
  12. a.push_back(g);
  13. }
  14. sort(a.begin(),a.end());
  15. for(i=0;i<n-1;i++)
  16. {
  17. cin>>g;
  18. b.push_back(g);
  19. }
  20. sort(b.begin(),b.end());
  21. k=a[n-1];
  22. for(i=0;i<n-1;i++)
  23. {
  24. //cout<<b[i]<<" "<<a[i]<<"\n";
  25. if(b[i]!=a[i])
  26. {
  27. k=a[i];
  28. break;
  29. }
  30. }
  31. cout<<k<<"\n";
  32. for(i=0;i<n-2;i++)
  33. {
  34. cin>>g;
  35. c.push_back(g);
  36. }
  37. sort(c.begin(),c.end());
  38. k=b[n-1];
  39. for(i=0;i<n-1;i++)
  40. {
  41. if(b[i]!=c[i])
  42. {
  43. k=b[i];
  44. break;
  45. }
  46. }
  47. cout<<k<<"\n";
  48. return 0;
  49. }
Success #stdin #stdout 0.01s 5520KB
stdin
6
1 4 3 3 5 7
3 7 5 4 3
4 3 7 5
stdout
1
3