Advertisement

字符串模拟——Flag

阅读量:

Flag

题面翻译

题目描述

按照最新发布的 ISO 标准, 每个国家的国旗都应该由一个 n\times m 的方格构成, 其中每个方格最多可容纳 10 种不同颜色. 此外, 国旗必须包含条纹: 每一行中的所有方块均呈现相同的颜色, 而相邻两行的颜色必须互不相同. 为了遵守这一规定, Berland 政府希望确定其国旗是否符合这一最新规定.

输入格式

输入的第一行包含数 nm,其中 n 为行数,m 为列数。

随后是对旗帜的描述:其中每一行由m个字符组成。每个字符都是介于0到9之间的数字,并表示相应正方形的颜色。

输出格式

如果国旗符合标准就输出 YES,否则输出 NO

题目描述

According to a new ISO standard, every nation's flag must incorporate a checkerboard pattern denoted as n×m, where each individual square within this checkerboard must be colored using one color from ten available options. The entire design is cha

全部评论 (0)

还没有任何评论哟~