CodeForces-12A-Super Agent

原创 2016年05月31日 22:17:50

Description

There is a very secret base in Potatoland where potato mash is made according to a special recipe. The neighbours from Porridgia decided to seize this recipe and to sell it to Pilauland. For this mission they have been preparing special agent Pearlo for many years. When, finally, Pearlo learned all secrets of espionage, he penetrated into the Potatoland territory and reached the secret base.

Now he is standing at the entrance, but to get inside he need to pass combination lock. Minute ago one of the workers entered the password on the terminal and opened the door. The terminal is a square digital keyboard 3 × 3 with digits from 1 to 9.

Pearlo knows that the password consists from distinct digits and is probably symmetric with respect to the central button of the terminal. He has heat sensor which allowed him to detect the digits which the worker pressed. Now he wants to check whether the password entered by the worker is symmetric with respect to the central button of the terminal. This fact can Help Pearlo to reduce the number of different possible password combinations.

Input

Input contains the matrix of three rows of three symbols each. Symbol «X» means that the corresponding button was pressed, and «.» means that is was not pressed. The matrix may contain no «X», also it may contain no «.».

Output

Print YES if the password is symmetric with respect to the central button of the terminal and NO otherwise.

Sample Input
Input

XX.

.XX

Output

YES

Input

X.X
X..

Output

NO

水题
判断对称

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

int main()
{
    char s[4][4];
    for(int i=0;i<3;i++)
    {
        for(int j=0;j<3;j++)
        {
            scanf("%c",&s[i][j]);
        }
       // printf("1\n");
        getchar();
    }
    if(s[0][0]==s[2][2]&&s[0][1]==s[2][1]&&s[0][2]==s[2][0]&&s[1][0]==s[1][2])
    {
        printf("YES\n");
        return 0;
    }
    printf("NO\n");
    return 0;
}
版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

【水枚举】#12 A. Super Agent

A. Super Agent time limit per test 2 seconds memory limit per test 256 megabytes in...
  • okcd00
  • okcd00
  • 2014年04月26日 00:19
  • 549

12c 中Agent问题的描述及解决办法!

问题描述:在另一个节点安装完agent后OMS莫名其妙的down掉。  view sqlnet.log Directory does not exist for read/write [/app/...

OEM 12cR3使用agentDeploy方式安装agent

--在OMS服务器使用SYSMAN登录emcli,同步emcli [oracle@omsdb agent]$ $OMS_HOME/bin/emcli login -username=sysman -p...

JAVA学习笔记12——super关键字+继承的内存分析+组合

最近在看JAVA教学的视频,觉得老师讲的很好,同时借用源代码还有笔记来撰写本系列博客,记录自己的学习内容,同时也供看到的人学习。 进入第十二篇,首先来介绍super关键字: 这里注意一下,...

12.黑马程序员-this、super关键字

------- android培训、java培训、期待与您交流! ----------     1.this 是用于区分局部变量和成员变量同名的情况。this:代表本类的对象,到底代表哪一...

codeforces101156L——Super 2048

1、题意:给你一个2048游戏的图,然后问你向上下左右某一种操作后结果是什么,不明白啥意思的给你游戏… 2、分析:这题其实是个水题,只不过处理的方式值得一谈。。上下左右方向在旋转之后其实方式是一样的...

最快遍历完图中重要节点 树的直径 Codeforces 328 (Div. 2) D. Super M

http://codeforces.com/problemset/problem/592/D 题意 给你一棵树,树上有一些重要的点,超人必须要去。 然后让你选择一个点作为起点,使得从这个点开始遍历其他...

【27.66%】【codeforces 592D】Super M

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

Codeforces Round #328 (Div. 2) D. Super M

Super M ~~

【Codeforces Round 328 (Div 2)D】【树的直径 树的重心 贪心 两次dfs都找最小编号最远点】Super M 经过树上所有重要点的最小距离

#include #include #include #include #include #include #include #include #include #include #include #...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:CodeForces-12A-Super Agent
举报原因:
原因补充:

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