题意 n个数,找出有几对a.b 符合 a ^ b > max(a,b) .^表示异或号 分析 对于数a,如果它的二进制是: 1 0 1 0 0 1,那么和它 ^ 后 能比他大的数就是: 0 1 X X X X 0 0 0 1 X X 0 0 0 0 1 X 所以对应的b 在a的最高位1到后面第一次出现0之前,都为0,然后在a为0的位置里至少一个为1. 于是就是最高位1的位置有几个数储存下来就可以计算了. 代码 #include<cstdio> #include<cstring&g…
Team Formation Time Limit: 3 Seconds Memory Limit: 131072 KB For an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team from N students of his university. Edward knows the skill level of each stud…
B - Team Formation Description For an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team from N students of his university. Edward knows the skill level…
For an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team from N students of his university. Edward knows the skill level of each student. He has found that if two students with skill level A and B fo…
Team Formation Time Limit: 2 Seconds Memory Limit: 131072 KB For an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team from N students of his university. Edward knows the skill level of each student.…
转自——http://blog.csdn.net/qwe20060514/article/details/8112550 =============================以下是最小生成树+并查集======================================[HDU]1213 How Many Tables 基础并查集★1272 小希的迷宫 基础并查集★1325&&poj1308 Is It A Tree? 基础并查集★1856 More i…