fork download
  1. /*
  2.  * Author : Apu Das Orgho
  3.  * Problem : Help them!
  4.  * Created on : 27-09-2025
  5.  */
  6. #include<bits/stdc++.h>
  7. #define iamspeed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
  8. #define endl '\n'
  9. using namespace std;
  10. vector<bool> found(1005, 0);
  11.  
  12. int main() {
  13. iamspeed
  14. int t;
  15. cin >> t;
  16. while (t--) {
  17. int n;
  18. cin >> n;
  19. vector<int> v(n);
  20. int mn = 1005, mx = 0;
  21. for (int i = 0; i < n; i++) {
  22. cin >> v[i];
  23. found[v[i]] = true;
  24. mn = min(mn, v[i]);
  25. mx = max(mx, v[i]);
  26. }
  27. for (int i = mn; i <= mx; i++) {
  28. if (found[i]) {
  29. found[i] = false;
  30. continue;
  31. }
  32. cout << i << endl;
  33. }
  34. }
  35. return 0;
  36. }
  37.  
Success #stdin #stdout 0.01s 5324KB
stdin
Standard input is empty
stdout
Standard output is empty