码迷,mamicode.com
首页 >  
搜索关键字:combination sum ii    ( 27716个结果
8.另类方法求1+2+...+n
Another way to calculate sum of 1 to N.
分类:其他好文   时间:2014-05-22 03:33:00    阅读次数:201
nyoj--Divideing Jewels
题意:有十种珠宝用数字表示,现在给你每个珠宝的数量,问可不可以平均分给两个人。解题思路:DFS搜索可以写。将完全背包问题转换为搜索问题。具体代码:#include#include#includeusing namespace std;int num[15],sum;bool dfs(int n,in...
分类:其他好文   时间:2014-05-22 03:26:34    阅读次数:206
10.排序数组中和为给定值的两个数字
Find 2 numbers with given sum in sorted array.
分类:其他好文   时间:2014-05-22 01:53:17    阅读次数:288
26.打印所有和为S的连续正整数序列
Find continuous sequences between 1 to N whose sum equals to S.
分类:其他好文   时间:2014-05-21 23:59:57    阅读次数:394
sql基础复习
--1、while循环declare @sum intdeclare @i intset @i=1set @sum=0while(@i90) print @iendprint @sum--2、goto语句declare @num intset @num=100flag:print @numsel.....
分类:数据库   时间:2014-05-21 22:20:40    阅读次数:468
Allegro 反射仿真--IBIS模型转化
一、IBIS模型的获取a)直接找芯片供应商b) 从网上下载 i.到Google网站直接搜索某个型号的IBIS模型;ii.到器件厂商的官方网站下载;iii.从专门提供IBIS模型的网站搜索下载。c)仿真器件的SPICE 模型或直接测量二、IBIS模型的转化过程将模型的IBIS格式转化为DML格式,可以...
分类:其他好文   时间:2014-05-21 20:41:12    阅读次数:283
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 t...
分类:其他好文   时间:2014-05-21 07:42:18    阅读次数:230
Leetcode:Reverse Linked List II 单链表区间范围内逆置
Reverse a linked list from position m to n. Do it in-place and in one-pass. For example: Given 1->2->3->4->5->NULL, m = 2 and n = 4, return 1->4->3->2->5->NULL. Note: Given m, n satisfy the fol...
分类:其他好文   时间:2014-05-21 07:18:02    阅读次数:301
算法之大数问题
大数相加 [cpp] view plaincopy #include   #include      char a[10001],b[10001],sum[10002];      int BigIntegerAdd(){       //两个数的长度       int lena = strlen(a);       int l...
分类:其他好文   时间:2014-05-21 06:32:32    阅读次数:361
读入a,b当a,b不同时为零时结束
#define LOCAL#include#includeconst int MAX_N=100;int a[MAX_N],b[MAX_N];void init(){ for(int i=0;i=1) { if(b[sum-1]<10) printf(...
分类:其他好文   时间:2014-05-21 04:53:29    阅读次数:175
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!