码迷,mamicode.com
首页 >  
搜索关键字:palindrome numbers    ( 9163个结果
【LeetCode】- Valid Palindrome(正确的回文)
[ 问题: ] Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. 直译:给你一个字符串, 判定它是否是回文(只统计字母、数字,其他字符请忽略)。...
分类:其他好文   时间:2014-08-28 09:45:09    阅读次数:204
Permutations II
Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the following unique per...
分类:其他好文   时间:2014-08-27 21:55:38    阅读次数:242
poj 3252 Round Numbers(数位dp)
http://poj.org/problem?id=3252 "Round Number "被称为其二进制形式中0的个数比1的个数多。求[x,y]区间内“Round Number”的个数。 计数的时候最重要的是处理前导零,前导零不算数,因此与SCOI2009一样,增加一个标记变量first,标志着当前这意味是不是首位,不是首位的话1和0的个数都为0,否则根据枚举的1或0进行记忆...
分类:其他好文   时间:2014-08-27 20:36:48    阅读次数:211
Permutations
Given a collection of numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2,1,3], [2,3,1]...
分类:其他好文   时间:2014-08-27 20:26:38    阅读次数:168
数论 : 高精度 --- UVa 10183 : How Many Fibs ?
How many Fibs?DescriptionRecall the definition of the Fibonacci numbers:f1 := 1 f2 := 2 fn := fn-1 + fn-2 (n>=3) Given two numbers a and b, calcul...
分类:其他好文   时间:2014-08-27 20:17:48    阅读次数:208
uva 1406 - A Sequence of Numbers(树状数组)
题目链接:uva 1406 - A Sequence of Numbers 题目大意;给定n个数,有两种操作: Q x:计算与2x取且不为0的数的个数C x:每个数加上x 输出所有Q操作的和。 解题思路:因为x最大为15,所以开16个树状数组,fenx[x]记录的是每个数取模2x+1的情况,然后有一个add值标记总共加了多少。根据add值确定原先数的范围。 #include ...
分类:其他好文   时间:2014-08-27 18:47:58    阅读次数:242
find the closest sum to a target value
problem: given an array of integers including positive and negative, a target value. find 2 numbers in the array such that the sum of the 2 numbers is...
分类:其他好文   时间:2014-08-27 03:53:57    阅读次数:227
【Leet Code】Palindrome Number
Palindrome Number  Total Accepted: 19369 Total Submissions: 66673My Submissions Determine whether an integer is a palindrome. Do this without extra space. 判断一个数整数是不是回文?例如121,122...
分类:其他好文   时间:2014-08-27 01:40:27    阅读次数:180
25. Valid Palindrome
思想:简单的从两端来逐个读字符,判断是否相等。(36ms)
分类:其他好文   时间:2014-08-27 01:39:08    阅读次数:155
Permutations II <LeetCode>
Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2]have the following unique perm...
分类:其他好文   时间:2014-08-27 01:37:16    阅读次数:242
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!