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 }
  • 相关阅读:
    Delphi Help
    RAD 10 新控件 TSearchBox TSplitView
    滚动条
    c++builder Active Form
    chart左侧
    RAD 10 蓝牙
    浏览器插件 火狐插件
    c++builder delphi 调用dll dll编写
    模拟键盘 键盘虚拟代码
    oracle怎么把一个用户下的表复制给另一个用户?(授予表权限)
  • 原文地址:https://www.cnblogs.com/kuangbin/p/3275583.html
Copyright © 2011-2022 走看看