【CODEFORCES】 A. Appleman and Easy Task
来源:互联网 发布:肯尼迪绕丝数据 编辑:程序博客网 时间:2024/06/05 18:48
枚举每个点,然后输出....
#include<iostream>#include<cstdio>#include<cstring>using namespace std;char s[105][105]; int a[105][105],i,j,n;int _check(){ for (int i=0;i<n;i++) for (int j=0;j<n;j++) if (a[i][j]%2!=0) return 0; return 1;}int main(){ memset(s,0,sizeof(s)); scanf("%d",&n); for (i=0;i<n;i++) scanf("%s",&s[i]); for (i=0;i<n;i++) for (j=0;j<n;j++) { if (s[i-1][j]=='o' && i-1>=0) a[i][j]++; if (s[i+1][j]=='o') a[i][j]++; if (s[i][j-1]=='o' && j-1>=0) a[i][j]++; if (s[i][j+1]=='o') a[i][j]++; } if (_check()) cout <<"YES"; else cout <<"NO"; return 0;}
0 0
- 【CODEFORCES】 A. Appleman and Easy Task
- codeforces 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
- Codeforces 462A Appleman and Easy Task(水题)
- A. Appleman and Easy Task 8-26
- 462A - Appleman and Easy Task
- 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)
- 工作周报025
- Opencv各版本 win7 Visual Studio配置说明
- iOS工程适配64-bit
- IOS学习 关于ARC的在block块中的引用
- directshow学习笔记三-----视频预览(还未播放到指定窗口或控件,个人学习所用,仅供参考)
- 【CODEFORCES】 A. Appleman and Easy Task
- 使用java解压或者压缩zip文件
- android apk静默安装和卸载(2)
- Android Studio常用快捷键、Android Studio快捷键大全
- PHP高级应用
- calendar循环展示过去12个月
- Linux驱动开发学习的一些必要步骤
- android如何静默方式来安装apk(3)
- 手机彩票——Day01_1