Advertisement
Saleh127

Untitled

Apr 17th, 2020
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int b,c,d=0,e,i,j,k,l;
  6. cin>>b>>c;
  7. int a[b+10];
  8. for(i=1;i<=b;i++)
  9. {
  10. cin>>e;
  11. a[e]++;
  12. }
  13. for(j=1;j<=c;j++)
  14. {
  15. if(a[j]%2)
  16. {
  17. d++;
  18. }
  19. }
  20. cout<<b-d/2<<"\n";
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement