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

RESTful APIs with CRUD Operations in Laravel 12| (2025)

  RESTful APIs serve as the foundation of modern web development. They follow a set of rules called Representational State Transfer (REST) t...

Powered by Blogger.