Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int n,i,a,c=1,mx=0;
- vector<int> v;
- cin>>n;
- for(i=0;i<n;i++){
- cin>>a;
- v.push_back(a);
- }
- sort(v.begin(),v.end());
- for(i=0;i<n;i++){
- if(v[i]==v[i+1])
- {
- c++;
- }
- else
- {
- if(c>mx)
- mx=c;
- c=1;
- }
- }
- if(mx==0)
- cout<<'1'<<endl;
- else
- cout<<mx<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement