Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <set>
- using namespace std;
- int main()
- {
- int n, m;
- cin >> n >> m;
- set<int> st1, st2;
- for(int i = 0; i < n; ++i)
- {
- int a;
- cin >> a;
- st1.insert(a);
- }
- for (int i = 0; i < m; ++i)
- {
- int a;
- cin >> a;
- st2.insert(a);
- }
- for(int i : st1)
- {
- if(st2.count(i) == 0)
- {
- cout << i;
- break;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment