Pagini recente » Cod sursa (job #852437) | Cod sursa (job #2414430) | Cod sursa (job #2031789) | Cod sursa (job #2229112) | Cod sursa (job #703644)
Cod sursa(job #703644)
#include<iostream>
#include<fstream>
#include<vector>
using namespace std;
ifstream in("elmaj.in");
ofstream out("elmaj.out");
struct el {
int nr,val;
};
int n,smax;
vector<el> h[666013];
inline int ha(int nr) {
return nr%666013;
}
inline void add(int poz,int val) {
el tm;
int po = ha(poz);
vector<el>::iterator it;
tm.nr = poz; tm.val = val;
for(it=h[po].begin();it!=h[po].end();++it)
if(it->nr == poz) {
it->val+=val;
if(it->val > smax)
smax = it->val;
return;
}
h[ha(poz)].push_back(tm);
}
int main() {
int i,x;
in >> n;
for(i=1;i<=n;++i) {
in >> x;
add(x,1);
}
out << smax << "\n";
return 0;
}