ZOJ 2850: Beautiful Meadow
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ZOJ 2850: Beautiful Meadow相关的知识,希望对你有一定的参考价值。
///@author Sycamore, ZJNU ///@accepted_on 2017-01-19 #include<iostream> using namespace std; bool bl[10][10]; int main() { short M, N; while (cin >> M >> N&&M&&N) { bool b1=true,b2 = false; for (int i = 0; i<M; i++) for (int j = 0; j < N; j++) { cin >> bl[i][j]; if ((i&&bl[i][j] == 0 && bl[i - 1][j] == 0 )|| (j&&bl[i][j] == 0 && bl[i][j - 1] == 0)) { b1 = false; } if (b1&&!bl[i][j]) { b2 = true; } } cout << (b1&&b2 ? "Yes" : "No" )<< endl; } return 0; } #include<iostream> using namespace std; bool bl[10][10]; int main() { short M, N; while (cin >> M >> N&&M&&N) { bool b1 = true, b2 = false; for (int i = 0; i<M; i++) for (int j = 0; j < N; j++) { cin >> bl[i][j]; if ((i&&bl[i][j] == 0 && bl[i - 1][j] == 0) || (j&&bl[i][j] == 0 && bl[i][j - 1] == 0)) { b1 = false; } if (b1 && !bl[i][j]) { b2 = true; } } cout << (b1&&b2 ? "Yes" : "No") << endl; } return 0; }
以上是关于ZOJ 2850: Beautiful Meadow的主要内容,如果未能解决你的问题,请参考以下文章
json Webpack和Babel配置(Andrew Mead)
《南溪的目标检测学习笔记》——特征归一化(mead&std)