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;
}
相关文章
|
C语言
poj 2503 查字典
Description You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language.
837 0
poj 3664
http://poj.org/problem?id=3664 进行两轮选举,第一轮选前n进入第二轮,第二轮选最高   #include #include using namespace std; struct vote { int a,b; int c; ...
705 0
POJ-1003-hangover
Description How far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length.
737 0

热门文章

最新文章