Codeforces Round #309 (Div. 2) B. Ohana Cleans Up

简介:

题目链接:http://codeforces.com/contest/554/problem/B

#include <iostream>
#include <string>
#include <cmath>
using namespace std;

int main()
{
    int ans=0,m;
    while(cin>>m)
    {
        string s[105];
        for(int i=0; i<m; i++)
           cin>>s[i];
        for(int i=0; i<m; i++)
        {
            int sum=0;
            for(int j=0; j<m; j++)
                if(s[i] == s[j])
                  sum++;
            ans=max(ans,sum);
        }
        cout<<ans<<endl;
    }
    return 0;
}
目录
相关文章
|
9月前
|
机器学习/深度学习 人工智能 移动开发
.Codeforces Round 883 (Div. 3)
Codeforces Round 883 (Div. 3)
|
7月前
Codeforces Round #186 (Div. 2)A、B、C、D、E
Ilya得到了一个礼物,可以在删掉银行账户最后和倒数第二位的数字(账户有可能是负的),也可以不做任何处理。
22 0
|
7月前
|
人工智能 算法 BI
Codeforces Round #179 (Div. 2)A、B、C、D
我们每次加进来的点相当于k,首先需要进行一个双重循环找到k点和所有点之间的最短路径;然后就以k点位判断节点更新之前的k-1个点,时间复杂度降到O(n^3),而暴力解法每次都要进行floyd,时间复杂度为O(n^4);相比之下前述解法考虑到了floyd算法的性质,更好了运用了算法的内质。
34 0
|
8月前
Codeforces Round #742 (Div. 2)
Codeforces Round #742 (Div. 2)
27 0
|
9月前
|
机器学习/深度学习 人工智能
Codeforces Round 889 (Div. 2)
Codeforces Round 889 (Div. 2)
130 0
|
10月前
|
人工智能
Codeforces Round #786 (Div. 3)(A-D)
Codeforces Round #786 (Div. 3)(A-D)
54 0
Codeforces Round 799 (Div. 4)
Codeforces Round 799 (Div. 4)
93 0
|
人工智能 索引
Codeforces Round 806 (Div. 4)
Codeforces Round 806 (Div. 4)A~G
94 0
Codeforces Round 640 (Div. 4)
Codeforces Round 640 (Div. 4)A~G
67 0
|
人工智能 BI
Codeforces Round 827 (Div. 4)
Codeforces Round 827 (Div. 4)A~G题解
77 0