12A - Super Agent - CodeForces Solution


implementation *800

Please click on ads to support us..

Python Code:

a=input()
b=input()
c=input()
if a==c[::-1] and b[0]==b[2]:
    print("YES")
else:
    print('NO')

C++ Code:

#include<bits/stdc++.h>
using namespace std;
#define ll long long
 
int main(int argc, char const *argv[])
{
 char arr[3][3];
 for (int i = 0; i <3; i++)
 {
    for (int j = 0; j <3; j++)
    {
        cin>>arr[i][j];
    }
    
 }
 
 int flag=0;
  for (int i = 0; i <3; i++)
 {
    for (int j = 0; j <3; j++)
    {
       if (arr[0][0]==arr[2][2]&&arr[0][1]==arr[2][1]&&arr[0][2]==arr[2][0]&&arr[1][0]==arr[1][2])
       {
        cout<<"YES";
        flag=1;
        break;
       }
       
    }
    if(flag==1){
        break;
    }
 }
 if (flag==0)
 {
    cout<<"NO";
 }
 
return 0;
}


Comments

Submit
0 Comments
More Questions

922A - Cloning Toys
817A - Treasure Hunt
1136B - Nastya Is Playing Computer Games
1388A - Captain Flint and Crew Recruitment
592B - The Monster and the Squirrel
1081A - Definite Game
721C - Journey
1400A - String Similarity
1734E - Rectangular Congruence
1312D - Count the Arrays
424C - Magic Formulas
1730C - Minimum Notation
1730B - Meeting on the Line
1730A - Planets
302B - Eugeny and Play List
1730D - Prefixes and Suffixes
1515C - Phoenix and Towers
998A - Balloons
1734F - Zeros and Ones
1144B - Parity Alternated Deletions
92B - Binary Number
1144C - Two Shuffled Sequences
1154B - Make Them Equal
1272B - Snow Walking Robot
522B - Photo to Remember
608B - Hamming Distance Sum
1408F - Two Different
274B - Zero Tree
1726H - Mainak and the Bleeding Polygon
722A - Broken Clock