题目链接:点击打开链接 Imp is in a magic forest, where xorangles grow (wut?) A xorangle of order n is such a non-degenerate triangle, that lengths of its sides are integers not exceeding n, and the xor-sum of the lengths is equal to zero. Imp has to count the n…
C. Short Program time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Petya learned a new programming language CALPAS. A program in this language always takes one non-negative integer and retur…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2095 解题思路:因为只有我们要求的那个数出现的次数为奇数,所以可以用位运算来做,两次异或同一个数最后结果不变,那么就可以知道异或运算相当于过滤掉了出现次数为偶数的数,最后只留下了唯一的那一个出现次数为奇数的数. 反思:位运算好陌生,好好学. #include<stdio.h> int main() { int n; long int a; while(scanf("%d",&a…