Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete at most two transactions.
注意
You may n...
分类:
其他好文 时间:
2015-01-28 14:47:27
阅读次数:
197
新建项目默认会使用v7包中的主题,如果你workplace中没有v7库,那是一定会报错的。
1、导入v7jar,没用,因为需要的是v7的资源文件
2、既然如此,导入v7的整个项目应该ok了吧,import之后,尼玛还报错,百思不得骑姐,删了导,导了删,把SDK都弄坏了还是报错。并且build path还不报错。
终极大招,原来原因是因为v7库和项目没有在一个盘符下,import的...
分类:
其他好文 时间:
2015-01-28 14:46:02
阅读次数:
169
package com.yixin.webbrower;
/*
* 演示 Calendar 的一般操作
*/
import java.util.Date;
import java.text.SimpleDateFormat;
import java.text.DateFormat;
import java.util.Calendar;
public class TestTime
{
pu...
分类:
其他好文 时间:
2015-01-28 14:46:08
阅读次数:
182
STL中的pairing-heap优化dijkstra~...
分类:
其他好文 时间:
2015-01-28 14:45:41
阅读次数:
219
最后,鼓励大家针对你的研发工作里的问题和技术,
写几个小专利,对个人和企业有百利无一害。
学会梳理自己的思路,收集灵魂偶尔的电火花,打开脑洞、微创新。...
分类:
其他好文 时间:
2015-01-28 14:46:30
阅读次数:
233
题目链接:http://poj.org/problem?id=2387
dij 注意判重边
#include
#include
#include
#include
#include
using namespace std;
const int MAXV = 4010;
const int inf = 10000000;
int map[MAXV][MAXV];
int ...
分类:
其他好文 时间:
2015-01-28 14:46:58
阅读次数:
134
题目链接:ZigZag Conversion
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)
...
分类:
其他好文 时间:
2015-01-28 14:45:26
阅读次数:
93
题目链接:Reverse Integer
Reverse digits of an integer.
Example1: x = 123, return 321
Example2: x = -123, return -321
Have you thought about this?
Here are some good questions to ask before coding. Bo...
分类:
其他好文 时间:
2015-01-28 14:47:05
阅读次数:
156
题目链接:String to Integer (atoi)
Implement atoi to convert a string to an integer.
Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself w...
分类:
其他好文 时间:
2015-01-28 14:44:37
阅读次数:
154
dij 模板
通过 poj 2387 求去点1 -点 n 的最短路径
#include
#include
#include
#include
#include
using namespace std;
const int MAXV = 4010;
const int inf = 10000000;
int map[MAXV][MAXV];//路径长度
int d[MAXV];/...
分类:
其他好文 时间:
2015-01-28 14:44:15
阅读次数:
169
uva 10795 A Different Task
The (Three peg) Tower of Hanoi problem is a popular one in computer science. Briefly the problem is to transfer all the disks from peg-A to peg-C using peg-B as i...
分类:
其他好文 时间:
2015-01-28 14:45:37
阅读次数:
194
Skip
to main content
Data
Developer Center
Sign
in
United
States (English)
HomeLibraryLearnDownloadsSupportCommunityForums
...
分类:
其他好文 时间:
2015-01-28 14:45:43
阅读次数:
353
题目描述:给出一个词典,找出所有的复合词,即恰好有两个单词连接而成的单词。输入每行都是一个由小写字母组成的单词。输入已按照字典序从小到大排序,且不超过12000个单词。输出所有的复合词按照字典序从小到大排列。
思路:用set存储所有的单词,对于每个单词,遍历所有可能子单词组合,然后判断在set中是否都已经存储,若是则输出该单词。算法复杂度为O(n*lgn*|S|),其中|S|表示单词最大长度。
...
分类:
其他好文 时间:
2015-01-28 14:44:22
阅读次数:
131
题意:给定n*m的空白方格,进行k次涂色,将(x,y)处的方格涂成黑色,判断第几次涂色能形成2*2的黑色方格,若不能涂成2*2的方格,输出0。
涂(x,y)时总共就四种情况,四个 if 就能解决...
分类:
其他好文 时间:
2015-01-28 14:43:12
阅读次数:
164
向《最后的问题》和《这个男人来自地球》致敬
发现很多人都没看过啊~
-----------------------以下是大开脑洞的部分-------------------------
我是来自地球的那个男人。
那天我们谈论了很多,唯一没有提到的就是,其实我是搞金融的。...
分类:
其他好文 时间:
2015-01-28 14:43:40
阅读次数:
88
760mmHg=10.336m水柱。
注:一帕斯卡相当于在一平方米的范围放了两个鸡蛋的重量。
一个标准大气压,每平方米相当于承受了10吨的重量。...
分类:
其他好文 时间:
2015-01-28 14:43:58
阅读次数:
118