HDU 4696 Answers (2013多校10,1001题 )

时间:2023-03-09 21:02:51
HDU 4696 Answers (2013多校10,1001题 )

Answers

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

Problem Description
HDU 4696 Answers (2013多校10,1001题 )
Sample Input
2 4
2 2
2 1
0 1 2 3
Sample Output
NO
YES
YES
YES
Source
Recommend
zhuyuanchen520

分容易发现规律。

如果M<=0 肯定不行。

如果没有1,只能弄出偶数。

其余都可以

 /* ***********************************************
Author :kuangbin
Created Time :2013/8/22 13:25:04
File Name :F:\2013ACM练习\2013多校10\1001.cpp
************************************************ */ #include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <time.h>
using namespace std;
const int MAXN = ;
int T[MAXN],C[MAXN];
int M;
int main()
{
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
int N,Q;
while(scanf("%d%d",&N,&Q) == )
{
for(int i = ;i <= N;i++)
scanf("%d",&T[i]);
bool flag = false;
for(int i = ;i <= N;i++)
{
scanf("%d",&C[i]);
if(C[i] == )
flag = true;
}
while(Q--)
{
scanf("%d",&M);
if(M <= )
printf("NO\n");
else
{
if(flag)printf("YES\n");
else if(M%)printf("NO\n");
else printf("YES\n");
}
}
}
return ;
}