zoukankan      html  css  js  c++  java
  • bnu 4060 奇偶性,异或运算

    Plants vs. Zombies

    5000ms
    2048KB
     
    64-bit integer IO format: %lld      Java class name: Main
    Font Size:  
    Type:  

     植物大战僵尸(Plants vs. Zombies)是一款风靡全球的小游戏,游戏中可怕的僵尸即将入侵你的家庭,你唯一的防御方式就是你栽种的植物。

    一天早上起床,你惊讶地发现,游戏变成了事实:一大堆各种各样的僵尸正准备入侵你的寝室!而且僵尸种类远远多于游戏中的(有1000000000种!)更让人绝望的是你的那些植物无法种在水泥地板上,而你又忘了选花盆……

    这时~你突然发现你身后放着阿拉丁神灯!你抱着最后的希望轻轻地擦了擦神灯,大牛51isoft从神灯里钻了出来!!看着51isoft充满智慧的小眼睛,你明白你终于可以开始Programer vs. Zombies(PVZ)了!!
     
    51isoft不断地提升着自己的小宇宙,奋勇攻击着胆敢进入寝室的僵尸。但由于前不久大牛不幸把蹄儿给崴了,这次发挥有点失常,漏了一只僵尸没有杀死,你的任务就是找出大牛漏掉的僵尸是哪一种。
     

    Input

    输入的第一行是一个整数T(T<=20)代表数据组数。对于每组数据,第一行是一个整数N(N<1000000)代表将进入寝室的僵尸总数,接下来的N*2-1行,每行有两个整数a b(用空格隔开),0<=a<=1,b<1000000000,若a=0 表示一只种类为b的僵尸进入宿舍,若a=1 表示51isoft打死了一只种类为b的僵尸。

     

    Output

     输入一个整数,表示被漏掉的僵尸的种类。

     
     

    Sample Input

    2
    2
    0 1
    1 1
    0 2
    3
    0 13
    0 12
    0 13
    1 13
    1 13
    
     

    Sample Output

    2
    12
     

    Hint

     注意内存限制

     

    Source

    Author

    temperlsyer
     1 #include<iostream>
     2 #include<cstdio>
     3 #include<cstring>
     4 #include<cstdlib>
     5 using namespace std;
     6 
     7 int main()
     8 {
     9     int t;
    10     int n,m,i,hxl,x,y;
    11     while(scanf("%d",&t)>0)
    12     {
    13         while(t--)
    14         {
    15             hxl=0;
    16             scanf("%d",&n);
    17             m=n*2-1;
    18             for(i=1;i<=m;i++)
    19             {
    20                 scanf("%d%d",&x,&y);
    21                 hxl=hxl^y;
    22             }
    23             printf("%d
    ",hxl);
    24 
    25         }
    26     }
    27     return 0;
    28 }
  • 相关阅读:
    路径变量@PathVariable/请求参数@RequestParam的绑定以及@RequestBody
    JSR303后端校验详细笔记
    创建ssm项目步骤
    利用 R 绘制拟合曲线
    在 Linux 中将 Caps 根据是否为修饰键分别映射到 esc 和 Ctrl
    Master Transcription Factors and Mediator Establish Super-Enhancers at Key Cell Identity Genes
    Genomic Evidence for Complex Domestication History of the Cultivated Tomato in Latin America
    Variation Revealed by SNP Genotyping and Morphology Provides Insight into the Origin of the Tomato
    The genetic, developmental, and molecular bases of fruit size and shape variation in tomato
    微信支付jsapi
  • 原文地址:https://www.cnblogs.com/tom987690183/p/3348690.html
Copyright © 2011-2022 走看看