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 ...
随机推荐
- 关闭layer.open打开的页面
window.parent.location.reload(); //刷新父页面 var index = parent.layer.getFrameIndex(window.name); //获取窗口 ...
- jvm内存模型学习心得
昨天面试了两家,备受打击,问的多的就是jvm内存,然额真的是一头雾水.工作中用到的真是少之又少,面试还得问道, 今天恶补了下,在此作以下总结: jvm分为5部分 1.程序计数器 jvm支持多线程运行, ...
- sklearn系列之 sklearn.svm.SVC详解
首先我们应该对SVM的参数有一个详细的认知: sklearn.svm.SVC 参数说明: 本身这个函数也是基于libsvm实现的,所以在参数设置上有很多相似的地方.(PS: libsvm中的二次规划问 ...
- Maven聚合和继承
一.建立以pom为packaging的项目为,然后再以这一个项目为parent project来聚合其他子项目 新建立一个以pom的项目 改写pom文件,依赖web-common,这样 ...
- QBXT Day 5图论相关
图论是NOIP的一个非常重要的考点,换句话说,没有图论,NOIP的考纲就得少一大半(虽然很NOIP没有考纲) 图论这玩意吧,和数论一样是非常变态的东西,知识点又多又杂,但是好在一个事,他比较直观比较好 ...
- String 部分源码分析
String 无参数构造函数 /** * 底层存储字符串的目标字节数组, * Jdk 8 之前都是字符数组 private final char[] value; */ @Stable private ...
- Mysql基本管理知识
数据库的启动 [root@node80 ~]# /etc/init.d/mysqld start #mysqld是从安装包拷贝的mysql.server Starting MySQL. SUCCESS ...
- 阶段3 1.Mybatis_09.Mybatis的多表操作_7 mybatis多对多准备角色表的实体类和映射配置
创建Role表和user_role表 DROP TABLE IF EXISTS `role`; CREATE TABLE `role` ( `ID` int(11) NOT NULL COMMENT ...
- Java面试题集(71-85)
Java程序员面试题集(71-85) 摘要:这一部分主要包括了UML(统一建模语言).面向对象的设计原则(六原则一法则).GoF设计模式.企业级设计模式.JDBC(Java数据库连接).XML(可扩展 ...
- c++中byte数组与字符串的转化
我们不讨论与字符集有关的内容,只讨论在字节流传递过程中的问题. 我们在做一系统操作时会需要使用到数据流,比如接收网络数据,文件数据,图片数据,原始数据大多是以byte数组的形式提供,与其它语言(c#, ...