zoukankan      html  css  js  c++  java
  • 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
     
    Sample Input
    2 4 2 2 2 1 0 1 2 3
     
    Sample Output
    NO YES YES YES
     
    Source
     
    Recommend
    zhuyuanchen520
     

    分容易发现规律。

    如果M<=0 肯定不行。

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

    其余都可以

     1 /* ***********************************************
     2 Author        :kuangbin
     3 Created Time  :2013/8/22 13:25:04
     4 File Name     :F:2013ACM练习2013多校101001.cpp
     5 ************************************************ */
     6 
     7 #include <stdio.h>
     8 #include <string.h>
     9 #include <iostream>
    10 #include <algorithm>
    11 #include <vector>
    12 #include <queue>
    13 #include <set>
    14 #include <map>
    15 #include <string>
    16 #include <math.h>
    17 #include <stdlib.h>
    18 #include <time.h>
    19 using namespace std;
    20 const int MAXN = 100010;
    21 int T[MAXN],C[MAXN];
    22 int M;
    23 int main()
    24 {
    25     //freopen("in.txt","r",stdin);
    26     //freopen("out.txt","w",stdout);
    27     int N,Q;
    28     while(scanf("%d%d",&N,&Q) == 2)
    29     {
    30         for(int i = 1;i <= N;i++)
    31             scanf("%d",&T[i]);
    32         bool flag = false;
    33         for(int i = 1;i <= N;i++)
    34         {
    35             scanf("%d",&C[i]);
    36             if(C[i] == 1)
    37                 flag = true;
    38         }
    39         while(Q--)
    40         {
    41             scanf("%d",&M);
    42             if(M <= 0)
    43                 printf("NO
    ");
    44             else
    45             {
    46                 if(flag)printf("YES
    ");
    47                 else if(M%2)printf("NO
    ");
    48                 else printf("YES
    ");
    49             }
    50         }
    51     }
    52     return 0;
    53 }
  • 相关阅读:
    [转]VirtualBox错误 Unable to load R3 module 解决方案
    2014工作感想
    人生的真正价值
    react生成二维码
    判断对象中是否包含某个属性
    使用reduce进行数组对象去重
    filter筛选
    判断区分安卓ios
    scrollIntoView 与 scrollIntoViewIfNeeded API 介绍
    vue中使用@scroll实现分页处理(分页要做节流处理)
  • 原文地址:https://www.cnblogs.com/kuangbin/p/3275583.html
Copyright © 2011-2022 走看看