fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n, m, k, num;
  6. cin >> n >> m >> k;
  7. bool children[n];
  8. for (int i = 0; i < n; i++) {
  9. children[i] = false;
  10. }
  11. for (int i = 0; i < m + k; i++) {
  12. cin >> num;
  13. num--;
  14. children[num] = true;
  15. }
  16. cout << (n - m - k) << "\n";
  17. for (int i = 0; i < n; i++) {
  18. if (!children[i]) {
  19. cout << (i + 1) << " ";
  20. }
  21. }
  22. return 0;
  23. }
Success #stdin #stdout 0s 4384KB
stdin
7 2 1
7 3
1
stdout
4
2 4 5 6