[Codeforces]1003A. Polycarp's Pockets

題目URL: http://codeforces.com/contest/1003/problem/A
水題~記數後挑最大的即可


#include<bits/stdc++.h>
using namespace std;
int str[1005];
main()
{
    int a,num,maxu=0;
    cin >> num;
    while(num--)
    {
        cin >> a;
        str[a]++;
    }
    for(int i=0;i<1005;i++)
        maxu=max(maxu,str[i]);
    cout << maxu << endl;
    return 0;
}

留言

這個網誌中的熱門文章

[ZJ] b229: TOI 2009 第一題:路徑問題

交大資工(APCS組)(面試&心得)

滿是挫傷的ION CAMP