CF16A Flag
\[\large \text{Seek the truth from facts.} \]\[\large \text{实事求是} \]\[\mathtt{\text{2023.10.23 星期一}} \]\[\text{Program Difficulty = }\color{Green}{1\quad\boxed{\underline 2}\quad3\quad4}\quad\color{Orange}{5\quad6\quad7}\quad\color{Red}{8\quad9\quad10} \]\[\text{Thinking Difficulty = }\color{Green}{1\quad\boxed{\underline 2}\quad3\quad4\quad\color{Orange}{5\quad6\quad7}\quad\color{Red}{8\quad9}\quad10} \]\[\text{Comprehensive Difficulty = }\color{Green}{1\quad2\quad3\quad\boxed{\underline 4}\quad5\quad6\quad7}\quad\color{Orange}{8\quad9\quad10\quad11\quad12\quad13\quad14}\color{Red}{\quad15\quad16\quad17\quad18\quad19\quad20} \]\[\text{Star = }\color{Green}{\boxed{\underline 1}\quad2}\color{Orange}{\quad3\quad4}\color{Red}\quad5 \]
\(\text{Problem: }\)\(\color{Black}\text{CF16A}\)\(\texttt{, 518 B}\)
#include <iostream>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
int last_row=-1;
int this_row;
char t;
bool flg=true;
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
cin>>t;
t-='0';
if(j==1){
this_row=t;
if(last_row!=-1&&last_row==t){
cout<<"NO\n";
flg=false;
break;
}
}else if(this_row!=t){
cout<<"NO\n";
flg=false;
break;
}
}
if(!flg){
break;
}
last_row=this_row;
}
if(flg)cout<<"YES\n";
return 0;
}
标签:CF16A,color,text,int,Orange,quad,row
From: https://www.cnblogs.com/pr-hcx/p/17783321.html