codeforces 462A Appleman and Easy Task
来源:互联网 发布:kegg数据库是做什么 编辑:程序博客网 时间:2024/06/04 19:30
点击打开链接
水题,直接暴力。
#include<bits/stdc++.h>using namespace std;int main(){ int n; scanf("%d",&n); getchar(); char a[110][110]; for(int i=1;i<=n;i++) { for(int j=1;j<=n;j++) { scanf("%c",&a[i][j]); } getchar(); } bool flag=false; for(int i=1;i<=n;i++) { for(int j=1;j<=n;j++) { if(!flag) { int s=0; if(a[i-1][j]=='o'&&i-1>0&&i-1<=n&&j>0&&j<=n) s++; if(a[i+1][j]=='o'&&i+1>0&&i+1<=n&&j>0&&j<=n) s++; if(a[i][j-1]=='o'&&i>0&&i<=n&&j-1>0&&j-1<=n) s++; if(a[i][j+1]=='o'&&i>0&&i<=n&&j+1>0&&j+1<=n) s++; if(s%2==1) { flag=true; break; } } } if(flag) break; } if(flag) cout<<"NO"<<endl; else cout<<"YES"<<endl; return 0;}
阅读全文
0 0
- codeforces 462A Appleman and Easy Task
- 【CODEFORCES】 A. Appleman and Easy Task
- Codeforces 462A Appleman and Easy Task(水题)
- 462A - Appleman and Easy Task
- A. Appleman and Easy Task
- Codeforces Round #263 (Div. 2)A. Appleman and Easy Task
- Codeforces Round #263 (Div. 2)A. Appleman and Easy Task
- Codeforces Round #263 (div2) A. Appleman and Easy Task
- A. Appleman and Easy Task 8-26
- Appleman and Easy Task
- Codeforces Round #263 (Div. 2) A.Appleman and Easy Task(坑)
- Appleman and Easy Task-cf
- A. Appleman and Easy Task( brute force implementation)
- 【Codeforces Round 263 (Div 2)A】【水题 认真读题】Appleman and Easy Task 每个点的相邻o是否都为偶数
- Codeforces-461A Appleman and Toastman
- Appleman and Toastman - CodeForces 461 A 水题
- Codeforces 461A Appleman and Toastman
- A. Appleman and Toastman(codeforces#263div1)
- 专访小学宝创始人蒋晟:离开百度、搜狗,他想凭借 AI 撬动4500亿小学课外辅导市场
- 联想研究院八高管首次集体亮相 解析AI战略
- 业界 | 23篇论文入选CVPR2017, 商汤科技精选论文解读
- 市值超过 2900 亿的海康威视半年净利润 32.92 亿元,同比增长 26.22%
- 刚刚发布语音交互系统,猎户星空又刷新了人脸识别世界纪录
- codeforces 462A Appleman and Easy Task
- IBM全球首席资讯安全架构师Chenta Lee 携认知安全重磅回归CSS2017
- 智能判断交通事故、人流轨迹,城市大脑获世界级学术荣誉
- 干货:细数视频交友SDK的开放策略
- 为了第一时间购买到vivo这款新机,所有人把门店围的水泄不通
- HDFS Federation机制
- 一个半小时对话中,Elon Musk透露了SpaceX一系列最新动态
- Gartner组局顶级国际赛事 唯一“中国选手”入围
- 扛起AI大旗的联想 仍将重担压在刘军身上