Codeforces Round #799 (Div. 4) 1692C. Where's the Bishop? Solution

 



Problem Link: https://codeforces.com/contest/1692/problem/C

///La ilaha illellahu muhammadur rasulullah
///******Bismillahir-Rahmanir-Rahim******///
///Abul Hasnat  Tonmoy
///Department of CSE,23rd batch
///Islamic University,Bangladesh
///**********ALLAH IS ALMIGHTY************///
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int x,t,i,j,o,e,n,f;
    cin>>t;
    while(t--)
    {
        char ch[1000][1000];
        for(i=1; i<=8; i++)
        {
            f=0;
            for(j=1; j<=8; j++)
            {
                cin>>ch[i][j];
            }
        }
        for(i=2; i<=7; i++)
        {
            f=0;
            for(j=2; j<=7; j++)
            {
                if(ch[i][j]=='#'&&ch[i-1][j-1]=='#'&&ch[i+1][j+1]=='#')
                {
                    if(ch[i+1][j-1]=='#'&&ch[i-1][j+1]=='#')
                    {
                        cout<<i<<" "<<j<<endl;
                    }
                }
            }
        }
    }
}
 





No comments

Most View Post

Recent post

Codeforces Round 971 (Div. 4) 2009C. The Legend of Freya the Frog Solution

  Problem Link    https://codeforces.com/contest/2009/problem/C S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. h ...

Powered by Blogger.