Saleh127

cf 1385B

Jul 18th, 2020
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define test int t; cin>>t; while (t--)
  4. #define ll long long int
  5. #define fellow_junior ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  6. int main()
  7. {
  8. fellow_junior
  9. test
  10. {
  11. ll a[1000],c[1000]={0},d,e,f,i,j;
  12. cin>>e;
  13. for(i=1;i<=2*e;i++)
  14. {
  15. cin>>a[i];
  16. c[a[i]]++;
  17. }
  18. for(i=1;i<=2*e;i++)
  19. {
  20. d=a[i];
  21. if(c[d]>0)
  22. {
  23. cout<<d<<" ";
  24. c[d]=0;
  25. }
  26. }
  27. cout<<endl;
  28. }
  29.  
  30.  
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment