fork(1) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main() {
  4. int t;
  5. cin >> t;
  6. while (t--){
  7. long n; cin >> n;
  8. bool v[101] = {0};
  9. long total(0);
  10. for(long p = 0; p < n; p++){
  11. long x; cin >> x;
  12. total += 1 - v[x];
  13. v[x] = 1;
  14. }
  15.  
  16. cout << total << '\n';
  17. }
  18. return 0;
  19. }
Success #stdin #stdout 0.01s 5312KB
stdin
3
3
1 2 3
5
3 1 4 1 5
1
1
stdout
3
4
1