Plants vs. Zombies

Time Limit: 5000ms
Memory Limit: 2048KB
 
64-bit integer IO format: %lld      Java class name: Main
Font Size: + -
Type:  
None
 
Graph Theory
 
    2-SAT
 
    Articulation/Bridge/Biconnected Component
 
    Cycles/Topological Sorting/Strongly Connected Component
 
    Shortest Path
 
        Bellman Ford
 
        Dijkstra/Floyd Warshall
 
    Euler Trail/Circuit
 
    Heavy-Light Decomposition
 
    Minimum Spanning Tree
 
    Stable Marriage Problem
 
    Trees
 
    Directed Minimum Spanning Tree
 
    Flow/Matching
 
        Graph Matching
 
            Bipartite Matching
 
            Hopcroft–Karp Bipartite Matching
 
            Weighted Bipartite Matching/Hungarian Algorithm
 
        Flow
 
            Max Flow/Min Cut
 
            Min Cost Max Flow
 
DFS-like
 
    Backtracking with Pruning/Branch and Bound
 
    Basic Recursion
 
    IDA* Search
 
    Parsing/Grammar
 
    Breadth First Search/Depth First Search
 
    Advanced Search Techniques
 
        Binary Search/Bisection
 
        Ternary Search
 
Geometry
 
    Basic Geometry
 
    Computational Geometry
 
    Convex Hull
 
    Pick's Theorem
 
Game Theory
 
    Green Hackenbush/Colon Principle/Fusion Principle
 
    Nim
 
    Sprague-Grundy Number
 
Matrix
 
    Gaussian Elimination
 
    Matrix Exponentiation
 
Data Structures
 
    Basic Data Structures
 
    Binary Indexed Tree
 
    Binary Search Tree
 
    Hashing
 
    Orthogonal Range Search
 
    Range Minimum Query/Lowest Common Ancestor
 
    Segment Tree/Interval Tree
 
    Trie Tree
 
    Sorting
 
    Disjoint Set
 
String
 
    Aho Corasick
 
    Knuth-Morris-Pratt
 
    Suffix Array/Suffix Tree
 
Math
 
    Basic Math
 
    Big Integer Arithmetic
 
    Number Theory
 
        Chinese Remainder Theorem
 
        Extended Euclid
 
        Inclusion/Exclusion
 
        Modular Arithmetic
 
    Combinatorics
 
        Group Theory/Burnside's lemma
 
        Counting
 
    Probability/Expected Value
 
Others
 
    Tricky
 
    Hardest
 
    Unusual
 
    Brute Force
 
    Implementation
 
    Constructive Algorithms
 
    Two Pointer
 
    Bitmask
 
    Beginner
 
    Discrete Logarithm/Shank's Baby-step Giant-step Algorithm
 
    Greedy
 
    Divide and Conquer
 
Dynamic Programming
                   Tag it!

植物大战僵尸(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
 #include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
using namespace std; int main()
{
int t;
int n,m,i,hxl,x,y;
while(scanf("%d",&t)>)
{
while(t--)
{
hxl=;
scanf("%d",&n);
m=n*-;
for(i=;i<=m;i++)
{
scanf("%d%d",&x,&y);
hxl=hxl^y;
}
printf("%d\n",hxl); }
}
return ;
}
05-11 13:30
查看更多