poj 2864

简介:

这题题目很长,不过很简单,男校友、女校友只是干扰,这题用一个flag就可以搞定,如果出现一个不到场的情况,当个校友的flag直接置为否就可以了
上代码

#include <iostream>
#include <string>
using namespace std;

int flag[102];

int main()
{
    int N,D,i;
    int tmp;
    while (cin>>N>>D)
    {
        if(0 == N && 0== D)
            break;

        memset(flag,0,sizeof(flag));
        for(i=0;i<D;++i)
            for(int j=0;j<N;++j)
            {
                cin>>tmp;
                if(0 == tmp)
                    flag[j]=1;
            }

            for (i=0;i<N;++i)
            {
                if(0 == flag[i])
                {
                    cout<<"yes"<<endl;
                    break;
                }
            }
            if(i==N)
                cout<<"no"<<endl;
    }

    return 0;
}
相关文章
|
存储
POJ 1936 All in All
POJ 1936 All in All
89 0
|
人工智能 机器学习/深度学习
POJ 1012 Joseph
Joseph Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 53862   Accepted: 20551 Description The Joseph's problem is notoriously known.
852 0
POJ 1067 取石子游戏
取石子游戏 Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 40917   Accepted: 13826 Description 有两堆石子,数量任意,可以不同。
1135 0
POJ 1804
题目:http://poj.org/problem?id=1804 大意:给你一串数字,排序。求出最少的交换次数  \ 我用归并做的 #include #include using namespace std; int aa[500010],bb[500010]; long lon...
711 0
POJ 2487 Stamps
Description Background Everybody hates Raymond. He’s the largest stamp collector on planet earth and because of that he always makes fun of all the others at the stamp collector parties.
1079 0
|
机器学习/深度学习 算法