poj2864


 1 #include<iostream>
2 #include<cstdio>
3 #include<cmath>
4 using namespace std;
5 int main ()
6 {
7 int n,m;
8 while(scanf("%d %d",&m,&n)&&m&&n)
9 {
10 int t=0,flag=0;
11 int a[510][110]={0};
12 int i,j;
13 for(i=0;i<n;i++)
14 for(j=0;j<m;j++)
15 scanf("%d",&a[i][j]);
16 for(j=0;j<m;j++)
17 {
18 t=0,flag=0;
19 for(i=0;i<n;i++)
20 t+=a[i][j];
21 if(t==n){flag=1;break;}
22 }
23 if(flag)
24 printf("yes\n");
25 else
26 printf("no\n");
27 }
28 return 0;
29 }

poj2864

时间: 2024-11-23 02:37:27

poj2864的相关文章

poj2864 Pascal Library

Pascal Library Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5445   Accepted: 2610 Description Pascal University, one of the oldest in the country, needs to renovate its Library Building, because after all these centuries the building

模拟水题,查看二维数组是否有一列都为1(POJ2864)

题目链接:http://poj.org/problem?id=2864 题意:参照题目 哈哈哈,这个题discuss有翻译哦.水到我不想交了. #include <cstdio> #include <cstdlib> #include <cstring> int arr[510][110]; int main(void) { int r, c; int i, j; int flag; while(scanf("%d%d", &c, &