题目链接:

so easy

Time Limit: 2000/1000 MS (Java/Others)  

Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 138    Accepted Submission(s): 110

Problem Description
Given an array with

n

integers, assume f(S) as the result of executing xor operation among all the elements of set S. e.g. if S={1,2,3} then f(S)=0.

your task is: calculate xor of all f(s), here s⊆S.

 
Input
This problem has multi test cases. First line contains a single integer T(T≤20) which represents the number of test cases.
For each test case, the first line contains a single integer number n(1≤n≤1,000) that represents the size of the given set. then the following line consists of ndifferent integer numbers indicate elements(≤109) of the given set.
 
Output
For each test case, print a single integer as the answer.
 
Sample Input
1
3
1 2 3
 
Sample Output
0
In the sample,$S = \{1, 2, 3\}$, subsets of $S$ are: $\varnothing$, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}
题意:问一个集合的所有子集合的异或和的异或和;
思路:因为a^a=0;所以就看代码;
AC代码:
#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
using namespace std;
const long long mod=1e9+;
int main()
{ int t,n,a[];
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
for(int i=;i<=n;i++)
{
scanf("%d",&a[i]);
}
if(n==)
{
cout<<a[]<<"\n";
}
else cout<<""<<"\n";
}
return ;
}

hdu-5650 so easy(水题)的更多相关文章

  1. hdu 1106:排序(水题,字符串处理 + 排序)

    排序 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submissi ...

  2. HDU 4950 Monster (水题)

    Monster 题目链接: http://acm.hust.edu.cn/vjudge/contest/123554#problem/I Description Teacher Mai has a k ...

  3. HDU 4813 Hard Code 水题

    Hard Code Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.act ...

  4. HDU 4593 H - Robot 水题

    H - RobotTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.act ...

  5. HDOJ/HDU 2560 Buildings(嗯~水题)

    Problem Description We divide the HZNU Campus into N*M grids. As you can see from the picture below, ...

  6. HDOJ(HDU) 1859 最小长方形(水题、、)

    Problem Description 给定一系列2维平面点的坐标(x, y),其中x和y均为整数,要求用一个最小的长方形框将所有点框在内.长方形框的边分别平行于x和y坐标轴,点落在边上也算是被框在内 ...

  7. HDU - 1716 排列2 水题

    排列2 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submis ...

  8. HDU—2021-发工资咯(水题,有点贪心的思想)

    作为杭电的老师,最盼望的日子就是每月的8号了,因为这一天是发工资的日子,养家糊口就靠它了,呵呵  但是对于学校财务处的工作人员来说,这一天则是很忙碌的一天,财务处的小胡老师最近就在考虑一个问题:如果每 ...

  9. HDU 5650 so easy 数学

    so easy 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5650 Description Given an array with n integ ...

  10. hdu 5753 Permutation Bo 水题

    Permutation Bo 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5753 Description There are two sequen ...

随机推荐

  1. 传统数据仓库架构与Hadoop的区别

    一, 下面一张图为传统架构和Hadoop的区别 主要讲以下横向扩展和扩展横向扩展:(Mpp 是hash分布,具有20节点)添加新的设备和现有的设备一起提供负载能力.Hadoop中系统扩容时,系统平台增 ...

  2. YUM安装(卸载)KDE和GNOME

    YUM安装(卸载)KDE和GNOME显示系统已经安装的组件,和可以安装的组件:#yum grouplist 如果系统安装之初采用最小化安装,没有安装xwindow,那么先安装:#yum groupin ...

  3. PerconaXtraBackup-2.2.8手册翻译

    1.1.2 Percona Xtrabackup特性 * 不停机创建Innodb数据库热备 * 对Mysql数据库创建增量备份 * 压缩数据流方式备份到异地服务器 * 更加便捷创建新的mysql从库 ...

  4. MySQL查询优化程序

    1.利用EXPLAIN 语句,查看是否用到索引: EXPLAIN 2.下面的WHERE 子句说明了怎样进行这项工作.第一行中,优化程序将简化表达式4/2 为值2,然后使用my_col 上的索引快速地找 ...

  5. java.lang.IllegalStateException: ImageView no longer exists. You should not use this PhotoViewAttacher any more.

    java.lang.IllegalStateException: ImageView no longer exists. You should not use this PhotoViewAttach ...

  6. TFS 中工作项的定制-修改工作流

    我们都会用到TFS中的工作项.一般来说,最主要的会用到任务.bug这些工作流来进行项目管理里.但我们发现,实际上,有些模板中的工作流并不能完全符合我们的需要,因此我们会进行工作流的定制操作.下面就会通 ...

  7. Netty 高并发 (长文)

    目录 Netty+Zookeeper 亿级 高并发实战 (长文) 写在前面 1. 高并发IM架构与部分实现 1.1. 高并发的学习和应用价值 1.1.1. 高并发IM实战的价值 1.1.2. 高并发I ...

  8. 我的Android进阶之旅------>HTTP Header 详解

    HTTP(HyperTextTransferProtocol)即超文本传输协议,目前网页传输的的通用协议.HTTP协议采用了请求/响应模型,浏览器或其他客户端发出请求,服务器给与响应.就整个网络资源传 ...

  9. [ACM] FZU 2087 统计数边 (有多少边至少存在一个最小生成树里面)

    Problem Description 在图论中,树:随意两个顶点间有且仅仅有一条路径的图. 生成树:包括了图中全部顶点的一种树. 最小生成树:对于连通的带权图(连通网)G,其生成树也是带权的. 生成 ...

  10. git克隆远程分支

    $ git branch –r 查看远程branch信息 $ git checkout origin/dev检出远程分支 $ git branch -a 查看所有分支,包括本地和远程 可以使用chec ...