Combination Sum
Total Accepted: 17319 Total
Submissions: 65259My Submissions
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where
the ca...
分类:
其他好文 时间:
2014-09-01 12:42:03
阅读次数:
259
题目链接:
huangjing
这个题目暴力和线段树都可以过,但是都需要掌握一个规律。。
当队首元素移到队尾后,可定会减少a[i]个逆序对,然后增加n-1-a[i]个逆序对。
你看比如1移到队尾,那么1>0这个逆序对就会减少,2>1,3>1,4>1这些逆序对就会增加。。
所以发现这个规律就好做了。。
暴力做法就是直接那样模拟。。
线段树做法是首先建立一颗空树,然后插入之前...
分类:
其他好文 时间:
2014-09-01 10:50:13
阅读次数:
239
题目:UVA10624 - Super Number(dfs)
题目大意:给你n和m要求找出这样的m位数,从第n位到第m位都满足前i位是可以被i整除,如果没有这样的数,输出-1.有多个就输出字典序最小的那个。
解题思路:将每个位置都用0..9枚举一下,注意第一个字符不能是0,然后dfs判断每个位置是否都满足要求。注意这里是会爆long long的,所以要取模一下。本来以为这样的...
分类:
其他好文 时间:
2014-09-01 10:47:33
阅读次数:
243
随机输入一个数,判断它是不是对称数(回文数)(如3,121,12321,45254)。不能用字符串库函数 1 bool Symmetry(int input) 2 { 3 int number = input; 4 int reverse = 0; 5 while (numb...
分类:
其他好文 时间:
2014-09-01 10:33:52
阅读次数:
230
getPrice()?>PHP number_format() 函数getPrice());?>
分类:
其他好文 时间:
2014-09-01 10:29:22
阅读次数:
143
这次运气比较好,做出两题。本来是冲着第3题可以cdq分治做的,却没想出来,明天再想好了。A. On Number of Decompositions into Multipliers题意:n个数a1,a2, a3...an求n个数相乘与a1*a2*a3*a4...an相等的排列个数。分析:首先应该对...
分类:
其他好文 时间:
2014-09-01 01:35:52
阅读次数:
231
问题描述
Given a non-negative number represented as an array of digits, plus one to the number.
The digits are stored such that the most significant digit is at the head of the list....
分类:
其他好文 时间:
2014-08-31 23:05:42
阅读次数:
390
typeof用以获取一个变量或者表达式的类型,typeof一般只能返回如下几个结果:number,boolean,string,function(函数),object(NULL,数组,对象),undefined。如:alert(typeof (123));//typeof(123)返回"number...
分类:
Web程序 时间:
2014-08-31 22:54:41
阅读次数:
282
一、数据类型1.NumberNumber初值为NaN(Not a Number)NaN与所有数字的运算结果都是NaN所以计算时或判断时务必记得给Number赋初始值trace(100+NaN); //NaNtrace(0==NaN); //falsetrace(0!=NaN); //truetrac...
分类:
其他好文 时间:
2014-08-31 22:44:02
阅读次数:
300
CREATE TABLE INFORMIX.SYS_FIELDVALUE( VALUEID NUMBER(10) NOT NULL, PARENTKEY VARCHAR2(50 BYTE), TEXT VARCHAR2(100...
分类:
其他好文 时间:
2014-08-31 21:25:31
阅读次数:
234