题目:Given a collection of numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2,1,3], [2,....
分类:
编程语言 时间:
2014-08-03 10:09:25
阅读次数:
193
题目: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....
分类:
编程语言 时间:
2014-08-03 04:40:04
阅读次数:
351
E. Lucky ArrayPetya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains only the lucky...
分类:
其他好文 时间:
2014-08-02 23:22:24
阅读次数:
389
LightOJ 1205 - Palindromic Numbers (数位dp)
ACM
题目地址:SPOJ MYQ10 Mirror Number
题意:
求[a,b]中回文的个数。
分析:
是SPOJ MYQ01的简单版...其实有非递归方法的。
代码:
/*
* Author: illuz
* Blog: http:...
分类:
其他好文 时间:
2014-08-02 20:56:24
阅读次数:
218
注意只有高位放了1之后才能开始统计#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace ...
分类:
其他好文 时间:
2014-08-02 12:42:53
阅读次数:
200
题目:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999. 题解:这道题跟interger to roman一样都得先熟悉罗马数字的规则。罗...
分类:
编程语言 时间:
2014-08-02 10:01:33
阅读次数:
231
题目:Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.题解:这道题。。还有哪个roman to integer。。第一件事 就是先把r....
分类:
编程语言 时间:
2014-08-02 09:54:23
阅读次数:
314
题目:Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.Each ....
分类:
编程语言 时间:
2014-08-02 01:48:12
阅读次数:
246
看区别>>> for i in range(4):... print i... 0123>>> for i in range(4):... print i,... 0 1 2 3第一个自动回车;第二个没有自动回车,空格隔开。结论:print会在行尾自动加回车。改变这种行为可以在在输出...
分类:
其他好文 时间:
2014-08-02 01:34:12
阅读次数:
254
问题描述:Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the original list.For example,Given1->...
分类:
其他好文 时间:
2014-08-02 01:33:12
阅读次数:
249