题目链接 下午比赛的时候没有想出来,其实就是int型的数分为30个位,然后按照位来排列枚举. 题意:求n个数里面,取i个数异或的所有组合的和,i取1~n 分析: 将n个数拆成30位2进制,由于每个二进制位异或后相加和原来的数异或相加是一样的,所以只需要对每一位累加计算,用组合数学取数就行了,奇数个异或得1,偶数个异或得0,再乘以自己的二进制位值,复杂度O(30*n*n) #include <iostream> #include <cstdio> #include <cmath…
Wall Painting Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1026    Accepted Submission(s): 280 Problem Description Ms.Fang loves painting very much. She paints GFW(Great Funny Wall) every da…
Wall Painting Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4339    Accepted Submission(s): 1460 Problem Description Ms.Fang loves painting very much. She paints GFW(Great Funny Wall) every…
题意: 从给出的颜料中选出天数个,第一天选一个,第二天选二个... 例如:第二天从4个中选出两个,把这两个进行异或运算(xor)计入结果 对于每一天输出所有异或的和 $\sum_{i=1}^nC_{n}^{i}$ 思路: 0⊕0=0,1⊕0=1,0⊕1=1,1⊕1=0(同为0,异为1) 例如样例 4 1 2 10 1 这4个数的二进制表示分别为: 0 0 0 1 0 0 1 0 1 0 1 0 0 0 0 1 第一天: 分别选出 1, 2, 10 ,1 = 14 第二天: 从4个中选出2个进行异…
题目链接: Wall Painting Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2681    Accepted Submission(s): 857 Problem Description Ms.Fang loves painting very much. She paints GFW(Great Funny Wall) ev…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1348 Wall Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3386    Accepted Submission(s): 968 Problem Description Once upon a time there was a gre…
传送门: POJ:点击打开链接 HDU:点击打开链接 以下是POJ上的题: Wall Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 29121   Accepted: 9746 Description Once upon a time there was a greedy King who ordered his chief Architect to build a wall around the King's cast…
2014-05-02 15:53:50 题目连接 2013年南京现场赛的题目,现场的时候,排在我们前面的队伍基本都过了这题,我们后面的队伍也有不少过了这题,唯独我们没有.. 后来是Qingyu Shao想到了思路,然后就让他来敲,我记得当时是C(n,k)打表的时候出现了问题,好弱..于是乎就开始吃东西了. 回来之后就一直想A掉这题,但是一直没有思路.半年之后......今天问了下TYS,然后他给我讲了大体思路,才有点感觉. 大体思路:记录每一位上1的个数(这里只需要32位),对于第i天,必须要选…
Wall Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3139    Accepted Submission(s): 888 Problem Description Once upon a time there was a greedy King who ordered his chief Architect to build a w…
Problem Description Josh Lyman is a gifted painter. One of his great works is a glass painting. He creates some well-designed lines on one side of a thick and polygonal glass, and renders it by some special dyes. The most fantastic thing is that it c…