码迷,mamicode.com
首页 >  
搜索关键字:two sum    ( 31846个结果
【LeetCode】Combinations
Given two integersnandk, return all possible combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a solution is:[ [2,4], [3,4], [2,3],...
分类:其他好文   时间:2014-05-14 03:54:40    阅读次数:250
0301-APP-Dialog
显示7种Dialog下面是图,然后一次对应的代码实现 实现代码 new AlertDialog.Builder(AlertDialogSamples.this) .setIcon(R.drawable.alert_dialog_icon) .setTitle(R.string.alert_dialog_two_button...
分类:移动开发   时间:2014-05-13 05:47:34    阅读次数:446
Codeforces 429D Tricky Function 最近点对
题目链接:点击打开链接 暴力出奇迹。 正解应该是最近点对,以i点为x轴,sum[i](前缀和)为y轴,求任意两点间的距离。 先来个科学的暴力代码: #include #include #include #include #include #include using namespace std; #define N 100050 #define ll __int64 ll a[N], su...
分类:其他好文   时间:2014-05-13 05:45:30    阅读次数:283
leetcode第一刷_Minimum Path Sum
可以用递归简洁的写出,但是会超时。 dp嘛。这个问题需要从后往前算,最右下角的小规模是已知的,边界也很明显,是最后一行和最后一列,行走方向的限制决定了这些位置的走法是唯一的,可以先算出来。然后不断的往前推算。 用distance[i][j]保存从当前位置走到最右下角所需的最短距离,状态转移方程是从distance[i+1][j]和distance[i][j+1]中选一个小的,然后再加上自身的。...
分类:其他好文   时间:2014-05-13 00:13:56    阅读次数:339
[leetcode]Sum Root to Leaf Numbers @ Python
原题地址:http://oj.leetcode.com/problems/sum-root-to-leaf-numbers/题意:Given a binary tree containing digits from0-9only, each root-to-leaf path could repre...
分类:编程语言   时间:2014-05-12 01:28:30    阅读次数:440
leetcode --day12 Surrounded Regions & Sum Root to Leaf Numbers & Longest Consecutive Sequence
1、 ?? Surrounded Regions Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'. A region is captured by flipping all 'O's into 'X's in that surrounded region. For e...
分类:其他好文   时间:2014-05-11 18:52:32    阅读次数:293
Hibernate查询方式---HQL方式
这一种我最常用,也是最喜欢用的,因为它写起来灵活直观,而且与所熟悉的SQL的语法差不太多。条件查询、分页查询、连接查询、嵌套查询,写起来与SQL语法基本一致,唯一不同的就是把表名换成了类或者对象。其它的,包括一些查询函数(count(),sum()等)、查询条件的设定等,全都跟SQL语法一样。###...
分类:系统相关   时间:2014-05-11 17:36:26    阅读次数:290
UVA 1362 - Exploring Pyramids(计数问题+区间DP)
题目链接:1362 - Exploring Pyramids 白书上的例题,思路是对于每个结点,往后遍历分为左右两边子树来考虑,左边的子树为去掉根节点剩下的子树,而右边是要算上根节点的,这样就不会有重复的情况出现,然后根据乘法原理,左右两边情况相乘为总情况数,然后计算这些总和。  f[i][j]表示[i,j]结点的情况种数,那么 f[i][j] = sum{f[i + 1][k - 1] * ...
分类:其他好文   时间:2014-05-11 07:02:11    阅读次数:277
TI C66x DSP 系统events及其应用 - 5.2(PDSP配置)
本节讲述PDSP监控的配置。 QMSS PDSP:The queue manager sub system contains two or eight packed data structure processors (PDSP) and associated hardware that allow autonomous QMSS-related tasks with interrupt not...
分类:其他好文   时间:2014-05-11 04:02:36    阅读次数:507
[LeetCode]Binary Tree Maximum Path Sum, 解题报告
题目 Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. For example: Given the below binary tree,...
分类:其他好文   时间:2014-05-11 03:25:24    阅读次数:298
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!