-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathchn16g.cpp
More file actions
38 lines (32 loc) · 739 Bytes
/
chn16g.cpp
File metadata and controls
38 lines (32 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include<bits/stdc++.h>
#define MAX 100000
#define DEBUG(x) do { std::cout << #x << ": " << x << std::endl; } while (0)
using namespace std;
int main(){
int t,n,i,m,j,x;
long long p,num;
int v[MAX]={0};
cin>>t;
while(t--){
cin>>n;
num=0;
for(i=0;i<n;++i){
cin>>v[i];
//DEBUG(coal[i]);
}
for(i=0;i<n;++i){
if(v[i])
for(j=i+1;j<n;++j)
{
if(v[i]==v[j]){
v[j]=0;
num++;
}
}
else
continue;
}
cout<<num<<endl;
}
return 0;
}