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-07-09 23:00:38
阅读次数:
208
题目
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent
a number.
An example is the root-to-leaf path 1->2->3 which represents the number 123.
Find ...
分类:
其他好文 时间:
2014-07-08 21:43:08
阅读次数:
219
http://acm.hdu.edu.cn/showproblem.php?pid=4722
大致题意:若一个整数的各位数字之和是10的倍数,称这个数为"good number"。给出区间[A,B],求出该区间内"good number"的数的个数。
第一道数位dp,折腾了半天才明白怎么回事。
设dp[site][mod]表示到第site位(由高位向低位)前面各位数字之和对1...
分类:
其他好文 时间:
2014-07-08 20:46:41
阅读次数:
223
杭电服务器是慢啊。。
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define ll long long
#define N 1000005
sets;
ll ans[1783]={
126,153,688,1206,1255,1260,...
分类:
其他好文 时间:
2014-07-08 18:58:12
阅读次数:
252
You have two numbers represented by a linked list, where each node contains a single digit. The digits are stored in reverse order, such that the 1’s ...
分类:
其他好文 时间:
2014-07-08 13:34:40
阅读次数:
195
Swift学习——函数的使用和分类(四)
总结了一下Swift中的函数使用一共可以分为七类
1 ---- 没有返回值,没有参数的函数
2 ---- 有参数和返回值的函数
3 ---- 使用元祖来返回多个值
4 ---- 参数是可变的
5 ---- 函数的嵌套
6 ---- 函数可以作为另一个函数的返回值
7 ---- 函数可以作为参数
具体分析如下面代码所示...
分类:
其他好文 时间:
2014-07-06 11:55:33
阅读次数:
170
Description
Consider an infinite full binary search tree (see the figure below), the numbers in the nodes are 1, 2, 3, .... In a subtree whose root node is X, we can get the minimum number in this ...
分类:
其他好文 时间:
2014-07-06 11:36:14
阅读次数:
284
Elevator
Time Limit: 1000ms Memory limit: 32768K 有疑问?点这里^_^
题目描述
The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers de...
分类:
其他好文 时间:
2014-07-06 10:52:11
阅读次数:
188
;; Fermat's Little Theorem:
;; If N is a prime number and A is any positive integer less
;; than N, then A raised to the N-th power is congruent to A modulo N
;; Two numbers are said to be congruent...
分类:
其他好文 时间:
2014-07-06 09:05:22
阅读次数:
158
A message containing letters from A-Z is being encoded to numbers using the following mapping:
'A' -> 1
'B' -> 2
...
'Z' -> 26
Given an encoded message containing digits, determine the total numb...
分类:
其他好文 时间:
2014-07-05 23:41:41
阅读次数:
253