码迷,mamicode.com
首页 >  
搜索关键字:consecutive numbers    ( 8082个结果
UVA 10375 Choose and divide(数论)
The binomial coefficient C(m,n) is defined as m! C(m,n) = -------- n!(m-n)! Given four natural numbers p, q, r, and s, compute the the result of dividing C(p,q) by C(r,s). T...
分类:其他好文   时间:2014-08-18 23:37:43    阅读次数:274
HDU 1058 Humble Numbers (dp+打表)
先是想筛法素数表啊,然后1~2000000000枚举打表啊,结果越想越不对。 后来想到唯一分解定理,可是怎么实现呢。。果然还是需要努力啊。。 研究了discuss代码,码之~ ~~~~ dp的思想,若dp[i]是Humble Numbers,那么dp[i]*2,dp[i]*3,dp[i]*5,dp[i]*7都将是Humble Numbers。 所以只需要注意连续性便好了。 #inclu...
分类:其他好文   时间:2014-08-18 18:32:52    阅读次数:166
UVA - 10892 LCM Cardinality (枚举因子)
A pair of numbers has a unique LCM but a single number can be the LCM of more than one possible pairs. Forexample 12 is the LCM of (1, 12), (2, 12), (3,4) etc. For a given positive integer N, the ...
分类:其他好文   时间:2014-08-18 16:25:24    阅读次数:240
Combination Sum II
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T....
分类:其他好文   时间:2014-08-17 17:03:22    阅读次数:184
POJ 1692 Crossed Matchings(DP)
Description There are two rows of positive integer numbers. We can draw one line segment between any two equal numbers, with values r, if one of them is located in the first row and the other one i...
分类:其他好文   时间:2014-08-16 23:52:01    阅读次数:560
POJ 之 1002 :487-3279
487-3279Time Limit: 2000MSMemory Limit: 65536KTotal Submissions: 242418Accepted: 42978DescriptionBusinesses like to have memorable telephone numbers. ...
分类:其他好文   时间:2014-08-16 21:00:21    阅读次数:275
UVA 1406 - A Sequence of Numbers(树状数组)
UVA 1406 - A Sequence of Numbers 题目链接 题意:给定一些数字,每次操作 C x 表示所有数字加上x Q x 表示答案加上与2x进行且操作不为0的个数 E 结束,并输出答案 思路:树状数组,首先观察,对于每次查询x而言,只有前x位是是有用的,所以可以开16个树状数组,每个数组表示数字对应前x位下的数字,然后就可以搞了,已经现在加过值为sum,...
分类:其他好文   时间:2014-08-16 17:10:20    阅读次数:227
Combination Sum
Given a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thesamerepeated num...
分类:其他好文   时间:2014-08-16 17:03:50    阅读次数:174
487-3279
Problem Description Businesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or phrase. For example, you can call the U...
分类:其他好文   时间:2014-08-16 16:28:10    阅读次数:185
[leetcode]Minimum Path Sum
Minimum Path SumGiven amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along ...
分类:其他好文   时间:2014-08-16 02:13:49    阅读次数:189
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!