这道题在前两个的基础上做稍微改进就可以。下面是AC代码: 1 /** 2 * Design an
algorithm to find the maximum profit. You may complete at most two transactions.
3 * @pa...
分类:
其他好文 时间:
2014-07-22 23:01:13
阅读次数:
251
如果要编写定制的Apache模块,最总需要编译成Apache包。
命令如下:
% ./buildconf
% ./configure --prefix=/usr/local/apache
> --with-layout=Apache --enable-modules=most --enable-mods-shared=all > --with-mpm=prefork
% make
#mak...
分类:
其他好文 时间:
2014-07-22 22:59:34
阅读次数:
243
Space AntTime Limit:1000MSMemory Limit:10000KTotal
Submissions:2934Accepted:1874DescriptionThe most exciting space discovery
occurred at the end of th...
分类:
其他好文 时间:
2014-07-22 22:59:15
阅读次数:
365
DescriptionIn the game of DotA, Pudge’s meat
hook is actually the most horrible thing for most of the heroes. The hook is
made up of several consecuti...
分类:
其他好文 时间:
2014-05-05 11:32:29
阅读次数:
288
时间复杂度 O(d*n),d 为不同数字数目,n 为待排元素个数。分为: MSD(most
significant digit) 和 LSD(least significant digit)两种方法。MSD:从最高级别的 key
开始排序,每趟排序将所有元素分成 d 堆。LSD: 从最低级别的 k...
分类:
其他好文 时间:
2014-05-03 22:41:16
阅读次数:
418
Say you have an array for which theithelement
is the price of a given stock on dayi.If you were only permitted to complete at
most one transaction (ie...
分类:
其他好文 时间:
2014-05-02 00:37:20
阅读次数:
349
>>> d1 = dict(a = 1, b = 2)>>> d2
= dict(b = 2, c = 3)>>> d1 & d2 # 字典不?支持该操作Traceback (most recent
call last): File "", line 1, in TypeError: unsupp....
分类:
其他好文 时间:
2014-05-01 12:50:50
阅读次数:
341
Given n non-negative integers a1, a2,
..., an, where each represents a point at coordinate (i, ai). n vertical
lines are drawn such that the two endpoints of line i is at (i, ai) and (i,
0). Fin...
分类:
其他好文 时间:
2014-04-29 13:15:21
阅读次数:
415
Mrs Little likes digits most of all. Every year she tries to make the best number of the year. She tries to become more and more intelligent and every year studies a new digit. And the number she make...
分类:
其他好文 时间:
2014-04-29 13:13:21
阅读次数:
309
The blocks in the city of Fishburg are of square form. N avenues running south to north and Mstreets running east to west bound them. A helicopter took off in the most southwestern
crossroads and fl...
分类:
其他好文 时间:
2014-04-27 21:16:59
阅读次数:
255