####Median of Two Sorted Arrays >There are
two sorted arrays A and B of size m and n respectively. Find the median of the
two sorted arrays. The overa...
分类:
其他好文 时间:
2014-05-26 23:13:41
阅读次数:
265
Let S = s1 s2...s2n be a well-formed string of
parentheses. S can be encoded in two different ways:q By an integer sequence P =
p1 p2...pn where pi is...
分类:
其他好文 时间:
2014-05-26 22:07:33
阅读次数:
300
题目描述:The gray code is a binary numeral system
where two successive values differ in only one bit.Given a non-negative
integernrepresenting the total n...
分类:
其他好文 时间:
2014-05-26 21:30:04
阅读次数:
296
Sum square difference
Problem 6
The sum of the squares of the first ten natural numbers is,
12 + 22 + ... + 102 = 385
The square of the sum of the first ten natural numbers is,
(1 + 2 + ....
分类:
其他好文 时间:
2014-05-23 02:22:57
阅读次数:
193
题目链接:hdu 4825 Xor Sum
题目大意:中文题。
解题思路:将给定得数按照二进制建成一颗字典树,每一层分别对应的各个位数上的01状态。然后每一次查询,如果对应位置为0,则要往1的方向走,如果是1,则要往0的方向走。但是要注意,走的前提是对应分支是存在的。
#include
#include
#include
using namespace std;
//type...
分类:
其他好文 时间:
2014-05-23 02:15:15
阅读次数:
286
数学推导题,f(n)=n*(n+1)*(n+2)/6
推导思路如下:
#include"cstdio"
#include"cstring"
#include"cmath"
#include"cstdlib"
#include"iostream"
#include"algorithm"
#include"queue"
using namespace std;
int main()...
分类:
其他好文 时间:
2014-05-23 02:13:15
阅读次数:
269
Problem 1: Multiples of 3 and 5
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multip...
分类:
其他好文 时间:
2014-05-23 01:43:01
阅读次数:
253
Problem 2: Even Fibonacci numbers
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:
1, 2,...
分类:
其他好文 时间:
2014-05-22 23:29:44
阅读次数:
435
刷了这么长时间POJ了 可算看到了一个中文题,不容易啊~~。
题目大意:自己看。
解题思路:
dp[x1][y1][x2][y2][num]代表从(x1,y1)到(x2,y2)分成num+1块最小的平方和是多少。
下面是代码:
#include
#include
#include
int sum[10][10],board[10][10];
d...
分类:
其他好文 时间:
2014-05-22 23:06:07
阅读次数:
300
Problem 4: Largest palindrome product
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
Find the largest pal...
分类:
其他好文 时间:
2014-05-22 18:48:46
阅读次数:
355