AtCoder Beginner Contest 088 C Takahashi's Information
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的更多相关文章
- AtCoder Beginner Contest 088 (ABC)
A - Infinite Coins 题目链接:https://abc088.contest.atcoder.jp/tasks/abc088_a Time limit : 2sec / Memory ...
- 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- ...
- AtCoder Beginner Contest 100 2018/06/16
A - Happy Birthday! Time limit : 2sec / Memory limit : 1000MB Score: 100 points Problem Statement E8 ...
- AtCoder Beginner Contest 076
A - Rating Goal Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement Takaha ...
- AtCoder Beginner Contest 068 ABCD题
A - ABCxxx Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement This contes ...
- AtCoder Beginner Contest 154 题解
人生第一场 AtCoder,纪念一下 话说年后的 AtCoder 比赛怎么这么少啊(大雾 AtCoder Beginner Contest 154 题解 A - Remaining Balls We ...
- AtCoder Beginner Contest 172 题解
AtCoder Beginner Contest 172 题解 目录 AtCoder Beginner Contest 172 题解 A - Calc B - Minor Change C - Tsu ...
- atcoder beginner contest 251(D-E)
Tasks - Panasonic Programming Contest 2022(AtCoder Beginner Contest 251)\ D - At Most 3 (Contestant ...
- AtCoder Beginner Contest 052
没看到Beginner,然后就做啊做,发现A,B太简单了...然后想想做完算了..没想到C卡了一下,然后还是做出来了.D的话瞎想了一下,然后感觉也没问题.假装all kill.2333 AtCoder ...
随机推荐
- windows server 2008 r2 配置ftp (FileZilla Server )
1.需要个ftp 2.在华为云内部,用IIS,配置后如果用主动模式,客户端需要配置后客户端需要做配置才能访问,去掉√,见下图. 3.华为云的教程,配被动需要把1024以上的端口都放开,不安全! 但客户 ...
- [论文笔记] Improving Head Pose Estimation with a Combined Loss and Bounding Box Margin Adjustment
Improving Head Pose Estimation with a Combined Loss and Bounding Box Margin Adjustment 简介 本文提出了一种网络结 ...
- Spring 之 IOC ,DI 理论
本文是依照极客学院java<Spring之IOC>章节学习的心得.随笔记录 浅谈IOC:(Inversion of Control, 控制反转) Spring 核心容器,贯穿始终.所谓IO ...
- python学习笔记:(二)基本数据类型
python中的变量不需要声明,每个变量中使用前都必须赋值,变量赋值以后该变量才会被创建. 在python中变量就是变量,他没有类型,我们所说的类型是变量所指的内存中对象的类型. python3中有六 ...
- java四舍五入及注意点
package com.example.newtest.test; import java.math.BigDecimal; import java.math.RoundingMode; import ...
- 记一次Python pip安装失败的总结
pip 安装失败时,可能换此方法可解决1.升级pip版本,这个一般会主动提示python3 -m pip install --upgrade pip2.修改pip源,默认的pip源速度实在无法忍受,或 ...
- 【HANA系列】SAP HANA STUDIO客户端升级更新
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[HANA系列]SAP HANA STUDIO客 ...
- seaborn用heatmap画热度图
原文链接 https://blog.csdn.net/m0_38103546/article/details/79935671
- ES6生成器与迭代器
ES6迭代器的一个例子 function run(taskDef) { var task = taskDef(); var result = task.next(); // 递归执行迭代 functi ...
- Android的Monkey和MonkeyRunner
本文部分解释性语段摘自网络百科或其它BLOG,语句内容网络随处可见,也不知道谁是初始原创,便不再署名出处,如有雷同,还请见谅. Monkey 什么是Monkey Monkey是Android中的一个命 ...