码迷,mamicode.com
首页 >  
搜索关键字:two sum    ( 31846个结果
leetcode——Two Sum 两数之和(AC)
Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the target, whe...
分类:其他好文   时间:2014-06-09 23:14:45    阅读次数:264
LeetCode: Triangle [120]
【题目】 Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the following triangle [ [2], [3,4], [6,5,7], [4,1,8,3] ] The minimum path sum from top to...
分类:其他好文   时间:2014-06-08 17:52:45    阅读次数:235
LeetCode之Maximum Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest sum....
分类:其他好文   时间:2014-06-08 15:54:08    阅读次数:258
Light OJ 1278 Sum of Consecutive Integers N拆分成连续整数和
题目来源:Light OJ 1278 Sum of Consecutive Integers 题意:N拆分成连续整数和的方案数 思路:奇因数的个数 #include #include #include #include using namespace std; //筛素数 const int maxn = 10000010; bool vis[maxn]; int prime[10...
分类:其他好文   时间:2014-06-08 15:34:09    阅读次数:295
Recover Binary Search 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. Cou...
分类:其他好文   时间:2014-06-08 15:32:45    阅读次数:245
leetcode——Add Two Numbers 两个链表表示的正整数对其求和(AC)
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link...
分类:其他好文   时间:2014-06-08 15:30:28    阅读次数:227
一入python深似海--函数与文件
先上写干货,几个开源网站: github.com launchpad.netgitorious.orgsourceforge.netfreecode.com 今天介绍一下python函数和文件读写的知识。 函数 def print_two(*args):#That tells Python to take all the arguments to the function a...
分类:编程语言   时间:2014-06-08 10:37:23    阅读次数:277
2-SAT模版
const int maxn = 100010; int n, m; vector G[maxn*2]; bool mark[maxn*2]; int S[maxn*2], c; int a[maxn], b[maxn], sum; bool dfs(int x) { if(mark[x^1]) return false; if(mark[x]) return true; mark...
分类:其他好文   时间:2014-06-08 10:31:01    阅读次数:198
HDU1002--A + B Problem II
HDU1002--A + B Problem II...
分类:其他好文   时间:2014-06-08 04:56:06    阅读次数:242
LeetCode——Two Sum
Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the target, whe...
分类:其他好文   时间:2014-06-08 02:12:04    阅读次数:216
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!