Miyago147852

Cetvrta

Mar 10th, 2022
1,050
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #define IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  3. #define endll "\n\n"
  4.  
  5. using namespace std;
  6.  
  7. vector<int>::iterator findEle(vector<int> &v, int ele){
  8.     return find(v.begin(), v.end(), ele);
  9. }
  10.  
  11. signed main(){
  12.     IO;
  13.     #ifdef DEBUG
  14.         freopen("p.in", "r", stdin);
  15.         freopen("p.out", "w", stdout);
  16.     #endif
  17.     vector<int> x, y;
  18.     int n, m;
  19.     while (cin>>n>>m) {
  20.         if (findEle(x, n)!=x.end()){
  21.             x.erase(findEle(x, n));
  22.         }else x.push_back(n);
  23.         if (findEle(y, m)!=y.end()){
  24.             y.erase(findEle(y, m));
  25.         }else y.push_back(m);
  26.     }
  27.     cout<<x.front()<<" "<<y.front()<<endl;
  28.     return EXIT_SUCCESS;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment