题意:
给定n个点,m条有向边,邮箱容量。
起点在1,终点在n,开始邮箱满油。
下面m行表示起点终点和这条边的耗油量(就是长度)
再下面给出一个数字m表示有P个加油站,可以免费加满油。
下面一行P个数字表示加油站的点标。
再下面一个整数Q
下面Q行 u v 表示在u点有销售站,可以卖掉邮箱里的任意数量的油,每以单位v元。
问跑到终点能获得最多多少元。
先求个每个点的最大剩...
分类:
其他好文 时间:
2014-06-02 18:58:48
阅读次数:
306
Best Time to Buy and Sell Stock IISay you have
an array for which theithelement is the price of a given stock on dayi.Design an
algorithm to find the ...
分类:
其他好文 时间:
2014-06-02 15:01:53
阅读次数:
305
【题目】
Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.
For example,
Given:
s1 = "aabcc",
s2 = "dbbca",
When s3 = "aadbbcbcac", return true.
When s3 = "aadbbbaccc", return false.
【题意】
给定字符串s1,s2,s3, 判断s3是不是s1和s2中的字交叉组合...
分类:
其他好文 时间:
2014-06-02 10:58:24
阅读次数:
211
【题目】
Two elements of a binary search tree (BST) are swapped by mistake.
Recover the tree without changing its structure.
Note:
A solution using O(n) space is pretty straight forward. Could you devise a constant space solution?
confused what "{1,#,2,3}" ...
分类:
其他好文 时间:
2014-06-02 10:38:17
阅读次数:
246
root@OpenstackIcehouse2:~# cat
/etc/nova/nova-compute.conf
[DEFAULT]compute_driver=libvirt.LibvirtDriver[libvirt]virt_type=qemulibvirt_inject_partitio...
分类:
其他好文 时间:
2014-06-02 10:23:16
阅读次数:
347
1. matches() 匹配全部Pattern p =
Pattern.compile("reg");Matcher m =
p.matcher("String");System.out.println(m.matches());2:(matches
和find不要一起用,用reset()吐出来)...
分类:
编程语言 时间:
2014-06-02 10:19:32
阅读次数:
390
DescriptionThe police office in Tadu City
decides to say ends to the chaos, as launch actions to root up the TWO gangs in
the city, Gang Dragon and Ga...
分类:
其他好文 时间:
2014-06-02 09:38:19
阅读次数:
219
Given a stringS, find the longest palindromic
substring inS. You may assume that the maximum length ofSis 1000, and there
exists one unique longest pa...
分类:
编程语言 时间:
2014-06-02 09:22:03
阅读次数:
328
不知道大家有没有碰到这种文件,因为是乱码,文件无法删除,这时我们就可以考虑用下面的命令进行删除文件或目录 ls -i //列出文件节点 find ./
-inum XXX(节点号) -print -exec rm -rf {} \; //删除节点号文件 find . -inum XXXX(节点号) ...
分类:
系统相关 时间:
2014-06-02 06:37:25
阅读次数:
370
最近在知乎看到一句话,保持学习的有一种是你看到了更多的牛人,不甘心,真的不甘心。
Spring和hibernate整合的时候,jsp页面做展现,发现展现属性出现:
org.apache.jasper.JasperException: could not initialize proxy - no Session - Class: org.hibernate.p...
分类:
编程语言 时间:
2014-06-02 05:24:04
阅读次数:
254