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 ...
随机推荐
- eclipse连接Mysql和测试
一.前期准备: 1.eclipse 2.Mysql workbench 3.jdbc 下载地址:https://www.mysql.com/products/connector/ 点击JDBC Dri ...
- spring boot shiro redis整合基于角色和权限的安全管理-Java编程
一.概述 本博客主要讲解spring boot整合Apache的shiro框架,实现基于角色的安全访问控制或者基于权限的访问安全控制,其中还使用到分布式缓存redis进行用户认证信息的缓存,减少数据库 ...
- Abrt
https://abrt.readthedocs.io/en/latest/faq.html#unpackaged
- linux系统下自动删除前N天的日志文件
删除文件命令: find 对应目录 -mtime +天数 -name "文件名" -exec rm -rf {} \; 实例命令: find /opt/soft/log/ -mti ...
- webpack配置之webpack.config.js文件配置
webpack配置之webpack.config.js文件配置 webpack.config.js webpack resolve 1.总是手动的输入webpack的输入输出文件路径,是一件非常繁琐 ...
- python 3 爬虫
import urllib.request url = "http://www.oschina.net/" data = urllib.request.urlopen(url).r ...
- await Vue.nextTick() 的含义分析
概述 今天看别人的单元测试代码的时候碰到了一段代码 await Vue.nextTick(),初看起来不是很懂,后来通过查资料弄懂了,记录下来,供以后开发时参考,相信对其他人也有用. await Vu ...
- python接口自动化:requests+ddt+htmltestrunner数据驱动框架
该框架分为四个包:xc_datas.xc_driven.xc_report.xc_tools. xc_datas:存放数据,xc_driven:存放执行程序,xc_report:存放生成的报告,xc_ ...
- python+selenium模拟鼠标操作
from selenium.webdriver.common.action_chains import ActionChains #导入鼠标相关的包 ------------------------- ...
- Python web 面试题(一)
1.列举django的内置组件? url .view.model.template.中间件 2.列举django中间件的5个方法?以及django中间件的应用场景? process_request(s ...