There are many websites that allow you to custom handbags at very affordable prices. Custom diaper bags are usually more expensive, because they tend ...
分类:
其他好文 时间:
2014-08-11 14:30:02
阅读次数:
318
这道题目本身很简单,倒推回去,第K个是最优时,K+1时必然包含它.所以就从最后面的股票开始贪心法用最优解生成最优解.
难点1是去重,我直接用了个价格表去过滤,如果多个价格相等的同级最优解,就用他们中可能性最大的那个累加,其余的忽略.
难点2是大数计算.可能性可能有几十位的数字,所以封装了一个大数类.现在还不支持符号,只支持正数.后面需要用到负数的时候再说.
题目:
Buy Lo...
分类:
其他好文 时间:
2014-08-10 12:59:00
阅读次数:
436
The end of otherFor language training our Robots want to learn about suffixes.In this task, you are given a set of words in lower case. Check whether ...
分类:
其他好文 时间:
2014-08-05 10:51:49
阅读次数:
196
有一个正整数序列,求最短的子序列使得其和大于等于S,并输出最短的长度。用数组b[i]存放序列的前i项和,所以b[i]是递增的。遍历终点j,然后在区间[0, j)里二分查找满足b[j]-b[i]≥S的最大的i,时间复杂度为O(nlongn)。这里二分查找用到库函数lower_bound() 1 //#...
分类:
其他好文 时间:
2014-08-02 23:20:54
阅读次数:
269
AnagramsGiven an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.编程珠玑中的一道题,书中的解法很巧妙,我就直接搬来用了,时...
分类:
其他好文 时间:
2014-08-01 22:37:32
阅读次数:
162
Problem Description:
Given an array of strings, return all groups of strings that are anagrams.
Note: All inputs will be in lower-case.
分析:题目要求输出找出所有在字符串数组中的变形词,变形词的意思是指单词由相同的字母构成,只是字母在单词中的顺序...
分类:
其他好文 时间:
2014-08-01 16:09:01
阅读次数:
164
正则表达式正则表达式符号:"." : 任意字符"\\d" : 0-9任何数字"\\D" : 任何非数字"\\s" : 空白字符,如'\t','\n'"\\S" : 非空白字符"\\w" : 可用作标识符的字符,不包括'$'"\\W" : 不可用作标识符的字符"\\p{Lower}" : 小写字母{a...
分类:
编程语言 时间:
2014-07-30 12:00:33
阅读次数:
229
Oracle常用函数 ——TRUNC,TO_DATE,TO_CHAR,TO_NUMBER, SUBSTR,REPLACE,NVL ,TRIM,wm_concat,upper, lower,length,add_months(sysdate,1)...
分类:
数据库 时间:
2014-07-30 01:01:12
阅读次数:
499
文字数学字符[:alnum:]文字字符[:alpha:]数学字符[:digit:]非空字符(非空格,控制字符)[:graph:]大写字符[:upper:]小写字符[:lower:]控制字符[:xntrl:]非空字符,包括空格[:print:]标点符号[:punct:]所有空白字符(新行,空格,制表符)[:space:]十六进制数字(0-9a-fA-F)[:xd..
分类:
其他好文 时间:
2014-07-29 15:53:10
阅读次数:
197
题目:Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.题解:这道题看所给的字符串数组里面有多少个是同一个变形词变的。这道....
分类:
编程语言 时间:
2014-07-29 12:17:46
阅读次数:
267