当前位置:网站首页>[51nod p2106] an odd number of times [bit operation]
[51nod p2106] an odd number of times [bit operation]
2022-06-13 09:35:00 【Ayane.】
analysis :
Exclusive or
A number occurs an even number of times Their XOR value is 0 0 0 Otherwise, this number
CODE:
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#define reg register
using namespace std;
typedef long long ll;
int n,x,ans;
int main(){
scanf("%d",&n);
while(n--)
{
scanf("%d",&x);
ans^=x;
}
printf("%d",ans);
return 0;
}
边栏推荐
- C language: Simulated Implementation of library function strcpy
- Overloading of typical operators
- VDD,DVDD,AVDD,VCC,AFVDD,DOVDD,IOVDD
- 攻防世界-PWN-shell
- List list
- [implementation of depth first search]
- Class and object -- friend
- LeetCode 6096. Success logarithm of spells and potions (binary search)
- C#入门系列(十三) -- 初识结构体
- Yolov5 face learning notes
猜你喜欢
全新BMW i3的操控,能符合对3系之名产品的期待吗?
VGA常用分辨率及计算方法
(topological sorting +bfs) acwing 848 Topological sequence of digraph
Jenkins接入Openldap用戶認證
Jenkins accédant à l'authentification de l'utilisateur openldap
(dijkstra+ shortest path + edge traversal 0 (m)) acwing 850 Dijkstra finding the shortest path II
acwing 789. Range of numbers (dichotomy + suitable for understanding dichotomy boundary)
Trees and binary trees: traversal of binary trees
C language: deep understanding of pointers and arrays
Dynamic display of analog clock using digital clock in turtle Library
随机推荐
静态变量与一个类相关联,只要该类在内存中(只要您的应用程序终止,该变量就不存在)就可以使用。(堆本体,栈引用)
(dfs+ pruning + checkerboard problem +dood) acwing 843 N-queen problem
拜登:希望尽快签署两党枪支安全改革法案
turtle库的使用数字时钟模拟时钟动态显示
VGA common resolution and calculation method
Exercise 7-10 finding specified characters (15 points)
[pytorch environment installation]
阿里高级专家剖析 | Protocol的标准设计
turtle库显示系统时间
C language: sanziqi
Simple implementation of database link pool
Exception handling operation
Exploitation of competitive loopholes in attacking and defending world PWN play conditions
删除软链接
LeetCode 583. Deleting two strings
C language: five custom types
The turtle library displays the system time
VDD,DVDD,AVDD,VCC,AFVDD,DOVDD,IOVDD
Attack and defense world PWN shell
LeetCode 6096. 咒语和药水的成功对数(二分查找)