class Solution { public int minimumTotal(List> triangle) { int[] dp=new int[triangle.size()]; for(int i=triangle.size()-1;i>=0;i--) for(int j=0;j<=i;j... ...
分类:
其他好文 时间:
2017-09-30 11:33:51
阅读次数:
99
【题意】给定无向图,炸弹开始在1,在每个点爆炸概率p/q,不爆炸则等概率往邻点走,求在每个点爆炸的概率。 【算法】数学概率期望+高斯消元 【题解】令f[i]表示炸弹到达i点的概率(之前不爆炸)。 f[i]=∑f[j]*(1-Q)/d[j] 特别的,f[1]=∑f[j]*(1-Q)/d[j]+1(一开 ...
分类:
其他好文 时间:
2017-09-30 11:33:21
阅读次数:
139
class Solution { ListNode lnode=null; public TreeNode sortedListToBST(ListNode head) { int size=0; ListNode p=head; while(p!=null) { p=p.next; ... ...
分类:
其他好文 时间:
2017-09-30 10:16:30
阅读次数:
142
适用场景 进行join中至少有一个RDD的数据量比较少(比如几百M,或者1-2G) 因为,每个Executor的内存中,都会驻留一份广播变量的全量数据 Broadcast与map进行join代码示例 创建RDD 传统的join 使用Broadcast+map的join操作 ...
分类:
其他好文 时间:
2017-09-30 10:10:57
阅读次数:
185
/// /// 找出子字符串在字符串中的所有索引,"ccc"在"ccccc"中认为只有一个 /// /// /// /// private static List AllIndexOf(string str, string subStr) { List... ...
分类:
其他好文 时间:
2017-09-30 10:10:25
阅读次数:
146
class Solution { public int numDistinct(String s, String t) { int[][] dp=new int[t.length()+1][s.length()+1]; for(int i=0;i<=t.length();i++) for(int j... ...
分类:
其他好文 时间:
2017-09-30 10:00:28
阅读次数:
118
碰到的问题: 1,This type of page is not served. 修改View就碰到这个问题,解决办法就是add key="webpages:Enabled" value="true",修改Value值,从True到False,在从False到True。 2,View中自动提示@M ...
分类:
Web程序 时间:
2017-09-30 09:56:32
阅读次数:
190
中间件格式 中间件格式为一个高阶函数,外部的函数接收一个 options 参数,这样方便中间件提供一些配置信息,用来开启/关闭一些功能。执行后返回另一个函数,这个函数接收 ctx, next 参数,其中 ctx 为 context 的简写,是当前请求生命周期的一个对象,存储了当前请求的一些相关信息, ...
分类:
其他好文 时间:
2017-09-30 00:43:52
阅读次数:
213
原文地址:http://www.mybatis.org/spring/zh/mappers.html#MapperScannerConfigurer 为了代替手工使用 SqlSessionDaoSupport 或 SqlSessionTemplate 编写数据访问对象 (DAO)的代码,MyBati ...
分类:
移动开发 时间:
2017-09-29 23:12:15
阅读次数:
575
题目描述: Life is a journey, and the road we travel has twists and turns, which sometimes lead us to unexpected places and unexpected people. Now our jour ...
分类:
其他好文 时间:
2017-09-29 21:21:25
阅读次数:
303