#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0)->sync_with_stdio(0);
int a, b;
cin >> a >> b;
set<int> s;
for (int i = 0, x; i < a; i++) {
cin >> x;
s.emplace(x);
}
for (int i = 0, x; i < b; i++) {
cin >> x;
s.erase(x);
}
cout << s.size() << "\n";
for (auto num : s) {
cout << num << " ";
}
cout << "\n";
return 0;
}
'백준 풀이 C++' 카테고리의 다른 글
백준 2581 C++ 소수찾기 (0) | 2022.09.17 |
---|---|
백준 5635번 c++ vector sort (0) | 2022.09.17 |
백준 2910번 c++ map활용 (0) | 2022.09.16 |
백준 1978 C++ (소수) (sqrt) (0) | 2022.09.04 |
백준 4344 C++ (소수 반올림, double화) (0) | 2022.09.03 |