码迷,mamicode.com
首页 >  
搜索关键字:two sum    ( 31846个结果
Bind9用view配主从
We use two Bind server to realize view, master, slave-------------------------------------------------------------------------------------------------...
分类:其他好文   时间:2014-07-22 22:57:13    阅读次数:299
LeetCode详细分析 :: Recover Binary Search Tree [Tree]
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 devis...
分类:其他好文   时间:2014-07-18 22:33:04    阅读次数:328
D_Dp
/* D - 简单dp 例题 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Description Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum ...
分类:其他好文   时间:2014-07-18 22:23:25    阅读次数:231
10165 - Stone Game(Nim游戏)
UVA 10165 - Stone Game 题目链接 题意:给定n堆石子,每次能在一堆取1到多个,取到最后一个赢,问谁赢 思路:就裸的的Nim游戏,利用定理求解 代码: #include #include int n, num; int main() { while (~scanf("%d", &n) && n) { int sum = 0; ...
分类:其他好文   时间:2014-07-18 22:17:20    阅读次数:342
LeetCode "Sum Root to Leaf Numbers"
A typical DFS usage, no big deal:class Solution {public: int dfs(TreeNode *p, int pval) { if( !p->left && !p->right ) { ...
分类:其他好文   时间:2014-07-17 09:55:25    阅读次数:171
LeetCode Jump Game
class Solution {public: bool canJump(int A[], int n) { if (A == NULL || n sum(n, 0); int jump = A[n-1]; for (int i=n-...
分类:其他好文   时间:2014-07-17 00:01:54    阅读次数:292
Adapter pattern
1. 定义http://en.wikipedia.org/wiki/Adapter_patternAn adapter helps two incompatible interfaces to work together. This is the real world definition for ...
分类:其他好文   时间:2014-07-16 19:01:47    阅读次数:345
sublime搜索和替换--正则
Search and Replace Sublime Text features two main types of search: Search - Single FileSearch - Multiple Files We’ll examine them in turn, but first let’s talk about a powerful tool for searc...
分类:其他好文   时间:2014-07-16 16:18:52    阅读次数:312
leetcode_Median of Two Sorted Arrays
Repost from:http://blog.csdn.net/yutianzuijin/article/details/11499917这是我做的第二个leetcode题目,一开始以为和第一个一样很简单,但是做的过程中才发现这个题目非常难,给人一种“刚上战场就踩上地雷挂掉了”的感觉。后来搜了一下...
分类:其他好文   时间:2014-07-16 15:19:06    阅读次数:244
Find the smallest number whose digits multiply to a given number n
Given a number ‘n’, find the smallest number ‘p’ such that if we multiply all digits of ‘p’, we get ‘n’. The result ‘p’ should have minimum two digits...
分类:其他好文   时间:2014-07-16 08:55:04    阅读次数:208
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!