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 ...
随机推荐
- VLC2.2.4命令参数
用法: vlc [选项] [流] ...您可以在命令行中指定多个流.它们将被加入播放列表队列.指定的首个项目将被首先播放. 选项样式: --选项 用于设置程序执行期间的全局选项. -选项 单字母版本的 ...
- React Native商城项目实战06 - 设置安卓中的启动页
1.Main 目录下新建LaunchImage.js: /** * 启动页 */ import React, { Component } from 'react'; import { AppRegis ...
- 提示标签title折行
使用代码换行共两种代码,均可实现html标签内title内容显示时换行.换行代码符分别为:“ ”和“ ”以上符合数字输入均必须英文半角模式输入.使用时候,在需要换行地方任选一种(组)换行符号代码即可.
- EasyHook(一)
前言 在说C# Hook之前,我们先来说说什么是Hook技术.相信大家都接触过外挂,不管是修改游戏客户端的也好,盗取密码的也罢,它们都是如何实现的呢? 实际上,Windows平台是基于事件驱动机制的, ...
- vs2019安装
1.下载vs_enterprise.exe(建议下载到无中文无空格目录) ,这个很小,官网下载企业版即可 2.在当前目录cmd命令执行: vs_enterprise.exe --layout offl ...
- 如何复制CSDN上他人的博客文章到自己博客下
原作者:hello_world!(CSDN) 原文地址:https://jingyan.baidu.com/article/0964eca24e159c8285f53618.html</a> ...
- robotframework的变量的使用
本篇用以记录RF的变量的使用 目录 1.简要介绍 2.使用关键字添加变量 3.使用菜单添加变量 1.简要介绍 RF可以通过菜单和关键字来添加变量,可以根据自己的需求来选择添加变量的方式 2.使用关键字 ...
- Spring中通过变量和import标签来控制加载哪些bean
需求:根据设置变量,来加载某个spring的bean的配置文件,这个配置文件中,有某些使用的bean.在一些情况下,不希望这些bean被初始化和加载进context中,也不需要被外面访问到. 在spr ...
- sql语句实现行转列的3种方法实例
sql语句实现行转列的3种方法实例 一般在做数据统计的时候会用到行转列,假如要统计学生的成绩,数据库里查询出来的会是这样的,但这并不能达到想要的效果,所以要在查询的时候做一下处理,下面话不多说了,来一 ...
- 模态框——angular
ui-bootstrap-tpls.js库 $uibModal服务 $uibModalInstance服务 一.在angular中应用modal $uibModal 使用方法:直接注入到控制器中. . ...