![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
位运算
ACM__dongsheng
在校大学生
展开
-
不用+,-,×,/做加法
转载于:http://www.cnblogs.com/python27/archive/2011/12/20/2295207.htmla=2进制的异或:保留本位,不进位。b= 2进制的或:刚好是保留进位。 a+b不会再有进位了。#include<iostream>#include<string>using namespace std;/*****************************转载 2016-04-09 10:47:46 · 300 阅读 · 0 评论 -
hdu hdu 5683 zxa and xor
zxa had a great interest in exclusive disjunction(i.e. XOR) recently, therefore he took out a non-negative integer sequence a1,a2,⋯,an of length n. zxa thought only doing this was too boring, hence a原创 2016-05-15 17:38:44 · 703 阅读 · 1 评论 -
国防科大校赛决赛-final(镜像赛) Problem B: XueXX and Binary
Description XueXX is a clever boy. And he always likes numbers in binary(二进制). What an interesting hobby! Now XueXX has some number in decimal(十进制), he wants to know how many “1”s in a number if the原创 2016-05-15 17:43:21 · 164 阅读 · 0 评论 -
hdu 3711 Binary Number
Description For 2 non-negative integers x and y, f(x, y) is defined as the number of different bits in the binary format of x and y. For example, f(2, 3)=1,f(0, 3)=2, f(5, 10)=4. Now given 2 sets of n原创 2016-06-23 11:35:40 · 167 阅读 · 0 评论