Skip to content

Commit

Permalink
Create 2037A-Twice.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
DionysiosB committed Nov 17, 2024
1 parent 8b10999 commit 64f59a9
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions 2037A-Twice.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <cstdio>
#include <map>

int main(){

long t; scanf("%ld", &t);
while(t--){
long n; scanf("%ld", &n);
std::map<long, long> m;
for(long p = 0; p < n; p++){
long x; scanf("%ld", &x);
++m[x];
}

long score(0);
for(std::map<long, long>::iterator it = m.begin(); it != m.end(); it++){score += (it->second) / 2;}
printf("%ld\n", score);
}

}

0 comments on commit 64f59a9

Please sign in to comment.