ZOJ 2975: Kinds of Fuwas

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ZOJ 2975: Kinds of Fuwas相关的知识,希望对你有一定的参考价值。

ZOJ 2975:  Kinds of Fuwas

 

///@author Sycamore, ZJNU
///@date 2017-02-07
#include<iostream>
using namespace std;
char mat[250][250];
int main()
{
    int T,M,N;
    cin >> T;
    while (T--)
    {
        cin >> M >> N;
        int c = 0;
        for (int i = 0; i < M; i++)
            for (int j = 0; j < N; j++)
                cin >> mat[i][j];
        if(M-1&&N-1)
        { 
        for(int top=0;top<M-1;top++)
            for(int left=0;left<N-1;left++)
                for (int bottom = top+1; bottom < M; bottom++)
                {
                    if (mat[top][left] == mat[bottom][left])
                    {
                        for (int right = left+1; right < N; right++)
                        {
                            if (mat[top][left] == mat[top][right] && mat[bottom][left] == mat[bottom][right])
                                c++;
                        }
                    }
                }
                
        }
        cout << c << endl;
    }
    return 0;
}

 

以上是关于ZOJ 2975: Kinds of Fuwas的主要内容,如果未能解决你的问题,请参考以下文章

哈理工2015暑假集训 zoj 2975 Kinds of Fuwas

Beautiful Soup:4 kinds of objects

These kinds of shoes ( ) well A.were not sold B.won't be sold C.are not sol

A simple introduction to Three kinds of Delegation of Kerberos

#DIP##OpenCV#Some Kinds Of Image Smoothing Methodologies

Seven Kinds of Testers - 七种类型的测试