码迷,mamicode.com
首页 >  
搜索关键字:palindrome numbers    ( 9163个结果
[LeetCode: 题解] Combination Sum
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeate...
分类:其他好文   时间:2014-08-08 20:54:46    阅读次数:246
B - Phone List
Description Given a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let’s say the phone catalogue listed these numbers: 1. Emergency 911 ...
分类:其他好文   时间:2014-08-08 12:49:16    阅读次数:187
POJ 3641 Pseudoprime numbers 米勒罗宾算法
链接:http://poj.org/problem?id=3641 题意:由费马小定理可得,对于素数p,a^p = a (mod p),但是对于某些非素数p,也有比较小的可能满足a^p = a (mod p),如果满足,则称p是a条件下的伪素数,现给出p,a,问p是不是a条件的伪素数。 思路:首先用米勒 罗宾判断p是不是素数,如果不是,判断a^p = a (mod p)是否成立。 代码: ...
分类:其他好文   时间:2014-08-08 12:42:05    阅读次数:232
LeetCode :: Next Permutation
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearrange it as the lowest possible o...
分类:其他好文   时间:2014-08-08 02:06:05    阅读次数:207
Permutations II leetcode java
题目:Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the following unique....
分类:编程语言   时间:2014-08-08 01:54:55    阅读次数:292
POJ 3292 Semi-prime H-numbers(数)
题意 所有可以表示为4*k+1(k>=0)的数都称为“H数” 而在所有“H数”中只能被1和自身整除的H数称为“H素数“ 能表示成两个”H素数“积的数又称为”Semi-prime H数“ 输入n 求1到n之间有多少个”Semi-prime H数“; 方法 先打个H素数表 再用H素数表中的数依次相乘 得到的数都标记 再用一个数组保存每个数以内的标记数 输入n后直接读数组就行了...
分类:其他好文   时间:2014-08-07 23:11:35    阅读次数:265
[leetcode]Palindrome Partitioning II
Palindrome Partitioning IIGiven a strings, partitionssuch that every substring of the partition is a palindrome.Return the minimum cuts needed for a p...
分类:其他好文   时间:2014-08-07 21:54:30    阅读次数:222
Sum Root to Leaf Numbers
该题可以用DFS解决,在DFS时记录path,当到达leaf时将path所表示的数加到sum上。 1 class Solution { 2 public: 3 int sumNumbers(TreeNode *root) { 4 vector path; 5 ...
分类:其他好文   时间:2014-08-07 18:50:40    阅读次数:197
Add Two Numbers
题目You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a singl...
分类:其他好文   时间:2014-08-07 12:51:00    阅读次数:188
Decode Ways leetcode java
题目:A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message....
分类:编程语言   时间:2014-08-07 05:11:09    阅读次数:247
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!