Description
There are two rows of positive integer numbers. We can draw one line segment between any two equal numbers, with values r, if one of them is located in the first row and the other one i...
分类:
其他好文 时间:
2014-08-16 23:52:01
阅读次数:
560
487-3279Time Limit: 2000MSMemory Limit: 65536KTotal Submissions: 242418Accepted: 42978DescriptionBusinesses like to have memorable telephone numbers. ...
分类:
其他好文 时间:
2014-08-16 21:00:21
阅读次数:
275
UVA 1406 - A Sequence of Numbers
题目链接
题意:给定一些数字,每次操作
C x 表示所有数字加上x
Q x 表示答案加上与2x进行且操作不为0的个数
E 结束,并输出答案
思路:树状数组,首先观察,对于每次查询x而言,只有前x位是是有用的,所以可以开16个树状数组,每个数组表示数字对应前x位下的数字,然后就可以搞了,已经现在加过值为sum,...
分类:
其他好文 时间:
2014-08-16 17:10:20
阅读次数:
227
Given a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thesamerepeated num...
分类:
其他好文 时间:
2014-08-16 17:03:50
阅读次数:
174
Problem Description
Businesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or phrase. For example, you can call the U...
分类:
其他好文 时间:
2014-08-16 16:28:10
阅读次数:
185
Minimum Path SumGiven amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along ...
分类:
其他好文 时间:
2014-08-16 02:13:49
阅读次数:
189
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the fol...
分类:
其他好文 时间:
2014-08-15 23:47:19
阅读次数:
302
本题需要使用选择矩阵的程序求解,这个和Leetcode上的一个程序是一样道理的。如果使用额外空间,那么是很容易做到的,这里不使用额外空间,直接使用到位操作,空间效率是O(1),这是个非常漂亮的到位旋转程序。
题意还是很重要,这次看错了一句话,就WA了一次:
The maximum amount of cells which contains two equal numbers after ov...
分类:
其他好文 时间:
2014-08-15 22:35:29
阅读次数:
288
普通的求区间连续和的问题,一开始因为是区间移动,但是怕UVA数据太严,直接打表,后来发现自己的担心是多余的。
14044972
1210
Sum of Consecutive Prime Numbers
Accepted
C++
0.049
2014-08-15 10:30:11
打表的话效率可能不是很高.
AC代码:...
分类:
其他好文 时间:
2014-08-15 19:43:29
阅读次数:
182
Colossal Fibonacci Numbers!
The i'th Fibonacci number f (i) is recursively defined in the following way:
f (0) = 0 and f (1) = 1f (i+2) = f (i+1) + f (i) for every i ≥ 0
Your task is to comput...
分类:
其他好文 时间:
2014-08-15 17:55:09
阅读次数:
241