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;
}
版权声明:本文为博主原创文章,未经博主允许不得转载。

codeforces 12A - Super Agent

判断中心对称 #include #include #include #include #include #include #include #include #i...
  • ymrfzr
  • ymrfzr
  • 2013年06月03日 07:14
  • 415

【Codeforces Testing Round 12A】【讨论 边界元素映射】Divisibility 区间范围内k倍数的数的个数

A. Divisibility time limit per test 1 second memory limit per test 256 megabytes in...
  • snowy_smile
  • snowy_smile
  • 2015年11月27日 09:23
  • 737

CodeForces 12A - Super Agent

热热脑袋! #include #include #include #include #include #include #include #include #include #in...
  • MrSiz
  • MrSiz
  • 2015年09月11日 00:16
  • 375

12A - Super Agent

A. Super Agent time limit per test 2 seconds memory limit per test 256 megabytes in...
  • liuke19950717
  • liuke19950717
  • 2016年07月21日 09:42
  • 183

A. Super Agent

time limit per test 2 seconds memory limit per test 256 megabytes input standard input ...
  • jj12345jj198999
  • jj12345jj198999
  • 2013年09月13日 09:02
  • 1083

CodeForces-12A-Super Agent

DescriptionThere is a very secret base in Potatoland where potato mash is made according to a specia...
  • Ypopstar
  • Ypopstar
  • 2016年05月31日 22:17
  • 210

A. Super Agent

A. Super Agenttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutpu...
  • u013077144
  • u013077144
  • 2016年04月21日 19:02
  • 99

Python解决codeforces ---- 4

第一题 10A A. Power Consumption Calculation time limit per test 1 second memory limit per tes...
  • cgl1079743846
  • cgl1079743846
  • 2013年10月07日 16:33
  • 1438

Microsoft Agent技术简介

话题686854的标题是: 谁知道如何创建类似office2000助手模样的窗体? (100分)分类:图形图象 Blackdell (2001-10-23 10:26:00)  就是只显示一幅透明的图...
  • flyloafer
  • flyloafer
  • 2006年04月23日 15:13
  • 3130

什么是 agent

agent 是任何通过sensor感知其环境并通过actuators在此环境中作出行动的东西。 比如人agent:sensor 是眼睛,耳朵,以及其他器官,actuators 是手,腿,声道等。 ...
  • cuit
  • cuit
  • 2017年02月28日 17:23
  • 336
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:CodeForces-12A-Super Agent
举报原因:
原因补充:

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