因为实验室项目好久没刷题了。从今天开始重新开始刷题。 Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers...
分类:
其他好文 时间:
2014-07-16 23:04:15
阅读次数:
166
Python支持5种数据类型,包括数字(numbers)、字符串(string)、列表(list)、元组(tuple)和字典(dictionary)。作为一门动态类型语言,不用去声明一个标示符的类型,使用的时候是什么类型会自动判定。对于定义好的变量,若不使用该变量,可以用del删除来释放占有的资源,...
分类:
编程语言 时间:
2014-07-16 22:52:11
阅读次数:
193
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,3,1],[3,...
分类:
其他好文 时间:
2014-07-16 20:58:41
阅读次数:
173
《Windows Graphics Programming Win32 GDI and DirectDraw》6.1节中有这样的描述:The Windows NT/2000 graphics engine uses signed fixed-point numbers to represent co...
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,3,1],[3,...
分类:
编程语言 时间:
2014-07-12 12:56:52
阅读次数:
206
Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-nega...
分类:
其他好文 时间:
2014-07-12 00:15:07
阅读次数:
268
Combination Sum IIGiven a collection of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sum...
分类:
其他好文 时间:
2014-07-11 08:41:13
阅读次数:
156
Description
Magic Numbers
Write a program that finds and displays all pairs ofintegers and
such that:
neither nor
have any digits repeated; and , where
N is a given i...
分类:
其他好文 时间:
2014-07-10 20:10:06
阅读次数:
238
大多数人的写法是进行位压缩,不过那样的话需要2^18*100 的空间,效率比较低,重复状态数较多,处理起来也不方便,这一题是给出了512M的空间。但是如果空间再小一倍,前者的方法就无能为力了。
发现有一种对于数位dp来说比较好的状态压缩方式,直接根据数码x出现的次数进行状态压缩。比如说333444,如果用前者的方法压缩就需要2^6=64的空间,而直接按照出现次数压缩就只需要3*3的空间,对于极限数据,利用均值不等式,也差不多只需(ceil(18/10+1)^10)=59049的空间,提高了空间的利用率(原来...
分类:
其他好文 时间:
2014-07-10 19:35:18
阅读次数:
213
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 Ts d...
分类:
其他好文 时间:
2014-07-09 15:35:19
阅读次数:
176