[ 问题: ]
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
直译:给你一个字符串, 判定它是否是回文(只统计字母、数字,其他字符请忽略)。...
分类:
其他好文 时间:
2014-08-28 09:45:09
阅读次数:
204
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
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
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
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
题目大意;给定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
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
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
思想:简单的从两端来逐个读字符,判断是否相等。(36ms)
分类:
其他好文 时间:
2014-08-27 01:39:08
阅读次数:
155
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