Advertisement
MohamedAbdel3al

B. CopyCopyCopyCopyCopy

Sep 15th, 2021
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std ;
  4. #define sz(s) int(s.size())
  5. typedef long long ll ;
  6. #define all(v) v.begin() , v.end()
  7.  
  8. void ABDEL3AL () {
  9. ios_base::sync_with_stdio(false); cin.tie(nullptr) , cout.tie(nullptr) ;
  10. #ifndef ONLINE_JUDGE
  11. freopen("input.txt" , "r" , stdin) , freopen("output.txt" , "w" , stdout) ;
  12. #endif
  13. }
  14.  
  15. int main() {
  16. ABDEL3AL() ;
  17. int t ; cin >> t ;
  18. while (t--) {
  19. int n ; cin >> n ;
  20. int sz = n ;
  21. ll arr[n] ;
  22. for (int i = 0; i < n; i++) cin >> arr[i] ;
  23. sort (arr , arr + n) ;
  24. for (int i = 1; i < n; i++)
  25. if (arr[i] == arr[i - 1]) sz -= 1;
  26. cout << sz << "\n" ;
  27. }
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement