标签:
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1563
当然比较直接的想法使用一个哈希表。但更好的方法是用异或!!
#include<stdio.h> int main(){ int n,m,s; while(scanf("%d",&n),n) { s=0; while(n--) { scanf("%d",&m); s^=m; } printf("%d\n",s); } return 0; }
标签:
原文地址:http://www.cnblogs.com/miaoz/p/4190947.html