3 solutions
-
0
先了解一下位运算异或的知识:https://blog.csdn.net/qq_19272431/article/details/78564391 然后你就会做这个题了
#include<stdio.h> typedef long long ll; int main(){ ll n,x,ans=0; scanf("%lld",&n); while(n--){ scanf("%lld",&x); ans^=x; } printf("%lld",ans); return 0; }
- 1
Information
- ID
- 185
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 8
- Tags
- # Submissions
- 318
- Accepted
- 37
- Uploaded By