HDOJ 4696 Answers 乱搞


乱搞:

rt。有1就能输出全部的数,否则仅仅能输出偶数

Answers

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 489    Accepted Submission(s): 294


Problem Description
 

Sample Input
2 4 2 2 2 1 0 1 2 3
 

Sample Output
NO YES YES YES
 

Source
 



#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

int n,m;
int t[100100],c[100100];

int main()
{
  while(scanf("%d%d",&n,&m)!=EOF)
    {
      bool flag=false;
      for(int i=1;i<=n;i++)
        scanf("%d",t+i);
      for(int i=1;i<=n;i++)
        {
          scanf("%d",c+i);
          if(c[i]==1) flag=true;
        }
      for(int i=0;i<m;i++)
        {
          int x;
          scanf("%d",&x);
          if(x<=0) puts("NO");
          else
            {
              if(flag) puts("YES");
              else
                {
                  if(x%2==0) puts("YES");
                  else puts("NO");
                }
            }
        }
    }
  return 0;
}



posted @ 2016-03-11 15:41  mengfanrong  阅读(166)  评论(0编辑  收藏  举报