poj2864

来源:互联网 发布:网络打印机图标灰色 编辑:程序博客网 时间:2024/05/29 08:58
#include<iostream>
using namespace std;
int att[120];
int main()
{
    int yes;
    int n,d;
    cin>>n>>d;
    while(n||d)
    {
        int i,j,k;
        yes=0;
        memset(att,1,sizeof(att));
        for(j=0;j<=d-1;j++)
        {
            for(i=0;i<=n-1;i++)
            {
                cin>>k;
                att[i]=att[i]&k;
            }
        }
        for(i=0;i<=n-1;i++)
          yes+=att[i];
        if(yes)
          cout<<"yes"<<endl;
        else
          cout<<"no"<<endl;
        cin>>n>>d;
    }
}
原创粉丝点击