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;
}
AI 代码解读
相关文章
POJ1013
大致题意: 有一打(12枚)硬币,其中有且仅有1枚假币,11枚真币 用A~L作为各个硬币的代号 假币可能比真币略轻,也可能略重 现在利用天枰,根据Input输入的3次称量,找出假币,并输出假币是轻还是重。
836 0
poj 2503 查字典
Description You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language.
879 0
poj 2395 Out of Hay
点击打开链接poj 2395 思路:求解最小生成树的最大边 注意:由于这里的长度最大到10^9,所以INF不能为0xFFFFFFF应该为0x3F3F3F3F。
691 0
POJ 2262 Goldbach&#39;s Conjecture
Problem Description In 1742, Christian Goldbach, a German amateur mathematician, sent a letter to Leonhard Euler in which he made the foll...
1024 0

热门文章

最新文章