CF 554B Ohana Cleans Up

原创 2015年07月07日 10:13:12

想清楚 看有多少一样的行

#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;

char  data[110][110];
int num_same[110];
/**
   0101
   1000
   1111
   0101
*/
int main()
{
    int n;
    while(cin>>n)
    {
        for(int i = 0;i < n;i ++)
        num_same[i] = 1;
        for(int i = 0;i < n;i ++)
        cin>>data[i];
        int ans = -1;
        for(int i = 0;i < n;i ++)
        {
            for(int j = 0;j < n;j ++)
            {
                if(strcmp(data[i],data[j]) == 0)
                {
                    num_same[i] ++;
                }
                if(j == i)
                num_same[i] --;
            }
        }
//        for(int i = 0;i < n;i ++)
//        cout<<num_same[i]<<endl;

        for(int i = 0;i < n;i ++)
        {
            if(num_same[i] > ans)
            ans = num_same[i];
        }
        cout<<ans<<endl;
    }
    return 0;
}


版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

CF 554B Ohana Cleans Up

B. Ohana Cleans Up time limit per test 2 seconds memory limit per test 256 megabytes ...

【59.49%】【codeforces 554B】Ohana Cleans Up

time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandar...

Codeforces 554B:Ohana Cleans Up(思维+水题)

B. Ohana Cleans Up time limit per test 2 seconds memory limit per test 256 megabytes ...

cf554B Cleans Up

Codeforces554B:Ohana Cleans Up

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

time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandar...

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

B. Ohana Cleans Up   Ohana Matsumae is trying to clean a room, which is divided up into an...

#309 (div.2) B. Ohana Cleans Up

1.题目描述:点击打开链接 2.解题思路:本题是一道简单的找最大值问题。只需要找出完全相同的行中个数那一行即可,输出它的个数。由于给定的范围比较小,可以直接用O(N^3)的算法解决。查找的时候用一个...

CodeForces 554B Ohana Cleans Up

Ohana Cleans Up Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u...

【codeforces】Ohana Cleans Up

B. Ohana Cleans Up time limit per test 2 seconds memory limit per test 256 megabytes ...

Ohana Cleans Up

Description Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid ...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)