Problem Statement

We have a 3×3 grid. A number ci,j is written in the square (i,j), where (i,j) denotes the square at the i-th row from the top and the j-th column from the left.
According to Takahashi, there are six integers a1,a2,a3,b1,b2,b3 whose values are fixed, and the number written in the square (i,j) is equal to ai+bj.
Determine if he is correct.

Constraints

  • ci,j (1≤i≤3,1≤j≤3) is an integer between 0 and 100 (inclusive).

Input

Input is given from Standard Input in the following format:

c1,1 c1,2 c1,3
c2,1 c2,2 c2,3
c3,1 c3,2 c3,3

Output

If Takahashi's statement is correct, print Yes; otherwise, print No.

Sample Input 1

1 0 1
2 1 2
1 0 1

Sample Output 1

Yes

Takahashi is correct, since there are possible sets of integers such as: a1=0,a2=1,a3=0,b1=1,b2=0,b3=1.

Sample Input 2

2 2 2
2 1 2
2 2 2

Sample Output 2

No

Takahashi is incorrect in this case.

Sample Input 3

0 8 8
0 8 8
0 8 8

Sample Output 3

Yes

Sample Input 4

1 8 6
2 9 7
0 7 7

Sample Output 4

No

枚举。
代码:
#include <bits/stdc++.h>
using namespace std;
int s[][];
int check()
{
if(s[][] - s[][] != s[][] - s[][] || s[][] - s[][] != s[][] - s[][])return ;
if(s[][] - s[][] != s[][] - s[][] || s[][] - s[][] != s[][] - s[][])return ;
if(s[][] - s[][] != s[][] - s[][] || s[][] - s[][] != s[][] - s[][])return ;
if(s[][] - s[][] != s[][] - s[][] || s[][] - s[][] != s[][] - s[][])return ;
if(s[][] - s[][] != s[][] - s[][] || s[][] - s[][] != s[][] - s[][])return ;
if(s[][] - s[][] != s[][] - s[][] || s[][] - s[][] != s[][] - s[][])return ;
return ;
}
int main()
{
for(int i = ;i < ;i ++)
{
for(int j = ;j < ;j ++)
{
cin>>s[i][j];
}
}
if(check())cout<<"Yes";
else cout<<"No";
}

AtCoder Beginner Contest 088 C Takahashi's Information的更多相关文章

  1. AtCoder Beginner Contest 088 (ABC)

    A - Infinite Coins 题目链接:https://abc088.contest.atcoder.jp/tasks/abc088_a Time limit : 2sec / Memory ...

  2. AtCoder Beginner Contest 088 D Grid Repainting

    Problem statement We have an H×W grid whose squares are painted black or white. The square at the i- ...

  3. AtCoder Beginner Contest 100 2018/06/16

    A - Happy Birthday! Time limit : 2sec / Memory limit : 1000MB Score: 100 points Problem Statement E8 ...

  4. AtCoder Beginner Contest 076

    A - Rating Goal Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement Takaha ...

  5. AtCoder Beginner Contest 068 ABCD题

    A - ABCxxx Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement This contes ...

  6. AtCoder Beginner Contest 154 题解

    人生第一场 AtCoder,纪念一下 话说年后的 AtCoder 比赛怎么这么少啊(大雾 AtCoder Beginner Contest 154 题解 A - Remaining Balls We ...

  7. AtCoder Beginner Contest 172 题解

    AtCoder Beginner Contest 172 题解 目录 AtCoder Beginner Contest 172 题解 A - Calc B - Minor Change C - Tsu ...

  8. atcoder beginner contest 251(D-E)

    Tasks - Panasonic Programming Contest 2022(AtCoder Beginner Contest 251)\ D - At Most 3 (Contestant ...

  9. AtCoder Beginner Contest 052

    没看到Beginner,然后就做啊做,发现A,B太简单了...然后想想做完算了..没想到C卡了一下,然后还是做出来了.D的话瞎想了一下,然后感觉也没问题.假装all kill.2333 AtCoder ...

随机推荐

  1. @清晰掉 Sizeof与字符串

    Sizeof与字符串 1.以字符串形式出现的,编译器都会为该字符串自动添加一个0作为结束符 如在代码中写  "abc",那么编译器帮你存储的是"abc/0" 2 ...

  2. LeetCode_001.两数之和

    LeetCode_001 LeetCode-001.两数之和 给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那两个整数,并返回他们的数组下标. 你可以假设每种输 ...

  3. kurento搭建以及运行kurento-hello-world

    搭建环境的系统是ubuntu 1.kurento服务器搭建 运行如下脚本即可完成安装 #!/bin/bash echo "deb http://ubuntu.kurento.org trus ...

  4. 在SOUI3中使用预编译XML

    传统的XML文件通常是utf8编码的文本文件.使用文本文件好处在于方便查阅及修改. SOUI使用XML做为布局描述语言,所有的布局资源都是XML.文本文件格式自由,XML解析器需要对文件中的字符逐个解 ...

  5. 【mysql】如何通过navicat配置表与表的多对一关系,一对一关系?设计外键的效果

    背景: 现在要将接口自动化测试结果持久化,当前只是每次运行接口测试,将测试结果通过邮件发送给项目组成员.邮件内容如下: 表设计: 为了呈现这个结果:我设计了2张表run_result和run_deta ...

  6. 使用Callable或DeferredResult实现springmvc的异步请求

    使用Callable实现springmvc的异步请求 如果一个请求中的某些操作耗时很长,会一直占用线程.这样的请求多了,可能造成线程池被占满,新请求无法执行的情况.这时,可以考虑使用异步请求,即主线程 ...

  7. 阶段3 1.Mybatis_11.Mybatis的缓存_6 Mybatis中的一级缓存

    Mybatis中的一级缓存和二级缓存         一级缓存:             它指的是Mybatis中SqlSession对象的缓存.             当我们执行查询之后,查询的结 ...

  8. 基于python+requests的简单接口测试

    在进行接口测试时,我们可以使用已有的工具(如:jmeter)进行,也可以使用python+requests进行.以下为简单的接口测试模板: 一.提取常用变量,统一配置 新建一个config.py文件, ...

  9. Hibernate一级缓冲

    Hibernate的一级缓冲 什么是缓冲 缓冲概念: 数据存在数据库中,数据库本身就是一个文件系统,使用流的方式操作文件,但是文件中有很多的内容,用流的操作得效率就低. 解决办法: 把数据存在内存中, ...

  10. windows下简单安装postgres

    目前版本是PostgreSQL 9.6,它经过以下平台认证: 32位Windows Windows 7,8和10 Windows 2008 Server 64位Windows Windows 7,8和 ...