码迷,mamicode.com
首页 >  
搜索关键字:combination sum ii    ( 27716个结果
循环-07. 爬动的蠕虫(15)
1 #include 2 using namespace std; 3 int u,d; 4 int sum(int t){ 5 if(t%2==0) 6 return (u-d)*t/2; 7 else 8 return u*(t/2+1)-d*t...
分类:其他好文   时间:2014-07-07 10:15:59    阅读次数:168
SQL Server索引 - 索引(物化)视图 <第九篇>
一、索引视图基本概念 索引视图实际上是一种将一组唯一值“物化”为群集索引形式的视图,所为物化就是几乎和表一样,其数据也是会存储一份的(会占用硬盘空间,但是查询速度快,例如可以将count(),sum()等值设在索引视图中)。其优点是它在提取视图背后的信息方面提供了一个非常快的查找方法。在第一个索引....
分类:数据库   时间:2014-07-07 09:55:14    阅读次数:212
循环-10. 求序列前N项和(15)
#include#includeusing namespace std;int main(){ double i,n,t,a,b; double sum=0; cin>>n; a=2; b=1; for(i=0;i<n;++i){ sum+=double(a)/b; t=a; a=a+b; ...
分类:其他好文   时间:2014-07-07 09:24:16    阅读次数:160
花神的数论题(数位dp)
规定sum[i] 为i里面含1的个数 ,求从1-N sum[i]的乘积。数为64位内的,也就是sum[i] 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include10 using ...
分类:其他好文   时间:2014-07-03 21:51:43    阅读次数:209
循环-16. 猴子吃桃问题(15)
1 #include 2 using namespace std; 3 int main(){ 4 int n,sum=1; 5 cin>>n; 6 while(--n) 7 sum=(sum+1)*2; 8 cout<<sum<<endl; 9 ...
分类:其他好文   时间:2014-07-03 21:46:34    阅读次数:253
循环-11. 水仙花数(20)
1 #include 2 #include 3 using namespace std; 4 int main(){ 5 int i,j,n,p[10],q,sum; 6 cin>>n; 7 for(i=0;i<=9;++i){ 8 p[i]=pow(i,n...
分类:其他好文   时间:2014-07-03 21:39:20    阅读次数:210
[LeetCode]Linked List Cycle II解法学习
问题描述如下:Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Follow up:Can you solve it without using extra s...
分类:其他好文   时间:2014-07-03 21:00:48    阅读次数:401
hust 1045 Task Arrangement II
题目描述There are N tasks and M resources, each task is asked to use some resources and each resource can only be used by at most one task. You are asked ...
分类:其他好文   时间:2014-07-03 20:35:23    阅读次数:274
[leetcode] Path Sum
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
分类:其他好文   时间:2014-07-03 13:02:23    阅读次数:200
leetcode 题解:Remove Duplicates from Sorted Array II(已排序数组去三次及以上重复元素)
题目:Follow up for "Remove Duplicates":What if duplicates are allowed at mosttwice?For example,Given sorted array A =[1,1,1,2,2,3],Your function should ...
分类:其他好文   时间:2014-07-03 12:10:12    阅读次数:191
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!