| 4 | using namespace std; |
| 5 | |
| 6 | int main() { |
| 7 | int t;//number of test cases |
| 8 | cin>>t; |
| 9 | while(t--){ |
| 10 | int n;//input the number of sticks |
| 11 | cin>>n; |
| 12 | int a[n],i;// for each valid i, the initial height of the stick in the i-th holder is A[i] |
| 13 | set<int>s; |
| 14 | for( i=0;i<n;i++){// for each stick |
| 15 | cin>>a[i]; |
| 16 | } |
| 17 | for( i=0;i<n;i++){ |
| 18 | if(a[i]!=0){ |
| 19 | s.insert(a[i]);// avoid all those height which is repeated |
| 20 | } |
| 21 | |
| 22 | } |
| 23 | |
| 24 | cout<<s.size()<<endl;//print the size of set |
| 25 | } |
| 26 | |
| 27 | return 0; |
| 28 | } |