码迷,mamicode.com
首页 >  
搜索关键字:combination sum    ( 21657个结果
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
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
nyoj 56 阶乘中素数的个数
给定两个数m,n,其中m是一个素数。 将n(0=n) { sum+=m/n m=m/n; }
分类:其他好文   时间:2014-06-08 00:20:05    阅读次数:348
Java 可变参数
可变参数可变参数可以当成一个数组使用public void sum(int ...nums){ int sum = 0; for(int i:nums) { sum +=i; } System.out.pri...
分类:编程语言   时间:2014-06-07 22:42:41    阅读次数:306
LeetCode:Minimum Path Sum
题目链接 Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its p...
分类:其他好文   时间:2014-06-07 21:59:08    阅读次数:344
codeforces Round #250 (div2)
a题,就不说了吧b题,直接从大到小排序1-limit的所有数的lowbit,再从大到小贪心组成sum就行了 1 #include 2 #include 3 #include 4 #include 5 #define N 200000 6 using namespace std; ...
分类:其他好文   时间:2014-06-07 21:49:57    阅读次数:272
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!