http://acm.hdu.edu.cn/showproblem.php?pid=1800 输出最多重复的level个数就ok #include<iostream> using namespace std; #include<map> int a[3010]; int main() { //freopen("a.txt","r",stdin); int n; while(scanf("%d",&n)!=EOF) { int i; map<int,int> m; for(i=0;i<n;i++) { int a; scanf("%d",&a); m[a]++; } map<int,int>::iterator it; int max=0; for(it=m.begin();it!=m.end();it++) { if(it->second>max) max=it->second; } printf("%d/n",max); } return 0; }