码迷,mamicode.com
首页 >  
搜索关键字:humble numbers    ( 7694个结果
POJ 3187 Backward Digit Sums(next_permutation)
Description FJ and his cows enjoy playing a mental game. They write down the numbers from 1 to N (1 <= N <= 10) in a certain order and then sum adjacent numbers to produce a new list with one fewer...
分类:其他好文   时间:2014-08-20 10:33:36    阅读次数:256
[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 o...
分类:其他好文   时间:2014-08-20 01:20:15    阅读次数:197
UVA - 12050 Palindrome Numbers
Description A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example, the name "anna" is a palindrome. Numbers can also be palindromes (e.g. 151 or 753357)....
分类:其他好文   时间:2014-08-19 12:57:34    阅读次数:189
Subclasses
Given a collection of numbers, return all possible subclasses. 1 public class Solution { 2 public List> permute(int[] num) { 3 ArrayList...
分类:其他好文   时间:2014-08-19 09:22:03    阅读次数:198
Kth order statistcs
Selection:selection is a trivial problem if the input numbers are sorted. If we use a sorting algorithm having O(nlgn) worst case running time, then t...
分类:其他好文   时间:2014-08-19 04:50:43    阅读次数:200
Next Permutation
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possibl...
分类:其他好文   时间:2014-08-19 00:57:53    阅读次数:213
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!