E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
palindrome
[leedcode 5]Longest Palindromic Substring
public class Solution { public String longest
Palindrome
(String s) { //本题是动态规划思想,构造一个数组pal
·
2015-10-23 09:47
substring
(字符串的处理4.7.16)POJ 1159
Palindrome
(让一个字符串变成回文串需要插入多少个字符...先逆序,在减去公共子序列的最大长度即可)
/* * POJ_1159.cpp * * Created on: 2013年10月29日 * Author: Administrator */ #include <iostream> #include <cstdio> #include <cmath> #include <algorithm> #inc
·
2015-10-23 09:49
字符串
HDU 4632
Palindrome
subsequence (2013多校4 1001 DP)
Palindrome
subsequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072
·
2015-10-23 08:23
sequence
HDU 4618
Palindrome
Sub-Array (2013多校2 1008 暴力)
Palindrome
Sub-Array Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535
·
2015-10-23 08:14
array
codeforce No to
Palindrome
s!(枚举)
1 /* 2 题意:给定一个字符串中没有任何长度>1的回文子串!求按照字典序的该串的下一个字符串 3 也不包含长度>1的任何回文子串! 4 5 思路:从最低位进行枚举,保证第i位 不与 第 i-1位和第 i-2位相同就好了!那么因为前边i-1 6 位没有长度>1的回文子串,那么前i位也不会出现!最后将最后边
·
2015-10-23 08:13
code
Palindrome
number
题目要求不能用额外的空间,这样就不能将数字转成str,然后递归了(递归要用到额外的空间)。 开始的想法是:把最高位的数字拿来和最低为的数字比较,若相等,则去掉最高位和最低位的数字,重复之前的操作,否则,返回False; 用的方法是整除和取余,可是没有考虑到例如1000021的情况,取余后得到的是21,前面的0全部忽略了。只适用于数字中除了中间的是0其他不是0的情况,如“123321”,“120
·
2015-10-23 08:11
number
【Leet Code】
Palindrome
Number
Palindrome
Number Total Accepted: 19369 Total Submissions: 66673 My Submissions
·
2015-10-23 08:33
number
【目录】Leetcode
Leetcode 1、动态规划
Palindrome
Partitioning II(hard) ☆ Distinct Subsequences(hard)
·
2015-10-23 08:29
LeetCode
[LeetCode 题解]:
Palindrome
Number
/www.cnblogs.com/double-win/category/573499.html 1.题目描述 Determine whether an integer is a
palindrome
·
2015-10-23 08:12
LeetCode
TOJ 4002
Palindrome
Generator
描述 A
palindrome
is a number that reads the same whether you read it from left to right or from right
·
2015-10-23 08:41
generator
acdream 1019
Palindrome
字符串hash
详见代码: #include <cstring> #include <cstdlib> #include <cstdio> #include <iostream> #define T 31LLU using namespace std; typedef unsigned long long Int64; // 给定一个字符串,现
·
2015-10-23 08:55
hash
URAL-1989 Sub
palindrome
s 多项式Hash+树状数组
题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1989 题意:给出一个字符串,m个操作:1,修改其中一个字符串,2,询问 [a, b] 是不是回文串。数据范围10^5。 如何快速判断字符串是不是回文串,可以用到多项式Hash。假设一个串s,那么字串s[i, j]的Hash值就是H[i, j]=s[i]+s[i+1]*x+
·
2015-10-23 08:44
hash
lintcode-最长回文子串-200
挑战O(n2)时间复杂度的算法是可以接受的,如果你能用O(n)的算法那自然更好classSolution{ public: stringlongest
Palindrome
(string&s){ if(
ljlstart
·
2015-10-23 01:00
Palindrome
Number
Question: Determine whether an integer is a
palindrome
. Do this without extra space. 4.
·
2015-10-22 21:07
LeetCode
[leetcode]
Palindrome
Number
classSolution{ public: boolis
Palindrome
(intx){ if(x<0)returnfalse; if(x<10)returntrue; inttemp1;
Mereyct
·
2015-10-21 22:00
LeetCode(125) Valid
Palindrome
题目Givenastring,determineifitisa
palindrome
,consideringonlyalphanumericcharactersandignoringcases.Forexample
fly_yr
·
2015-10-21 13:00
LeetCode
HDU 1544
Palindrome
s(回文子串)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1544 问题分析: 问题要求求出字符串的连续子串中的回文子串个数。首先,需要区分连续子串与子序列的区别。 连续子串为连续的字符组成的字符串;子序列需要满足在子序列中出现的字符的相对顺序与字符串中出现的相对顺序相同。 问题的解法:根据回文子串的长度分为奇数与偶数分为两种可能; 1
·
2015-10-21 13:19
HDU
Ann and Half-
Palindrome
字典树/半回文串
Ann and Half-
Palindrome
Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest
·
2015-10-21 12:44
codeforces
Valid
Palindrome
Given a string, determine if it is a
palindrome
, considering only alphanumeric characters and ignoring
·
2015-10-21 12:30
ROM
如何判斷回文(
palindrome
) ? (C/C++) (C) (STL)
palindrome
.c / C 1 /* 2 (C) OOMusou 2008 http://oomusou.cnblogs.com 3 4&
·
2015-10-21 12:54
c/c++
poj-1159
Palindrome
**
1 /* 2 * DA-term-
Palindrome
.cpp 3 * 4 * DP 5 * 6 * 动态规划求解。
·
2015-10-21 12:07
poj
HDOJ2029
Palindrome
s _easy version
Palindrome
s _easy version Time Limit: 2000/1000 MS (Java/Others) Memory Limit
·
2015-10-21 12:37
version
[LeetCode]
Palindrome
Partitioning
The problem has a nice structure that backtracking naturally fits in. The structure is, given a starting position idx, we search from idx till the end of the string s.length() - 1.
·
2015-10-21 12:05
partition
[LeetCode]
Palindrome
Linked List
Palindrome
Linked List Given a singly linked list, determine if it is a
palindrome
.
·
2015-10-21 12:20
LeetCode
[LeetCode] Shortest
Palindrome
Given a string S, you are allowed to convert it to a
palindrome
by adding characters in front of it.
·
2015-10-21 12:19
LeetCode
判断回文 c++
class Solution { public: bool is
Palindrome
(string s) { // Start typing your C/C++ solution
·
2015-10-21 12:05
C++
palindrome
class Solution { public: bool is
Palindrome
(string s) { // Start typing your C/C++ solution
·
2015-10-21 12:05
ROM
POJ 3280 Cheapest
Palindrome
(DP)
Description Keeping track of all the cows can be a tricky task so Farmer John has installed a system to automate it. He has installed on each cow an electronic ID tag that the system will read
·
2015-10-21 11:05
heap
Leetcode: Valid
Palindrome
简单模拟 代码: #include <iostream> #include <string> using namespace std; class Solution { public: bool isAlpha(char &in) { if(in >= 'a' && in <= 'z') r
·
2015-10-21 11:55
LeetCode
回文写法
测试字符串是否是回文字串 1. bool is_
palindrome
(char *str, int size) 2. { 3.
·
2015-10-21 11:22
回文
[leetcode]
Palindrome
Partitioning
暴力= = 枚举断开位置... 据说可以dp,等下试试 class Solution { public: bool isPal(const string& s , int start , int end){ end --; while(start < end){ if(s[start]
·
2015-10-21 11:11
partition
[leetcode]
Palindrome
Number
判断一个数字是否位回文,不能使用额外的空间。 最简单的就是转成字符串,然后来判断。 但是这题限制了不能用。 可以考虑就是把数字反转,然后看是否相等,但是又有个问题就是,反转了可能溢出。。。 我们每次取数字的头和尾的数字来比较! 设数字为x 末位= x % 10 首位=x / div 这个div是我们算出来的 int div = 1; while(x / div >= 10
·
2015-10-21 11:53
LeetCode
[leetcode]
Palindrome
Number
不知道我定义一个div变量算不算额外空间-,- class Solution { public: bool is
Palindrome
(int x) { // Start
·
2015-10-21 11:47
LeetCode
UVa_401 -
Palindrome
s
Palindrome
s A regular
palindrome
is a string of numbers or letters that is the same
·
2015-10-21 11:37
ROM
HDU 2020,2021,2024,2028,2029,2030
29日 09:55:28 // //2020 绝对值排序 //2021 发工资咯:) //2024 C语言合法标识符 //2028 Lowest Common Multiple Plus //2029
Palindrome
s_easy
·
2015-10-21 10:53
HDU
HDU 4618 -
Palindrome
Sub-Array(2013MUTC2-1008)(DP)
d(i,j,k)表示左上角坐标为(i,j),k为正方形边长 d(i,j,k)=1,如果d(i+1,j+1,k-2)=0,且上下两个外围的相等且回文,左右两个外围的相等且回文;否则d(i,j,k)=0 d(i,j,0)=1 d(i,j,1)=1 #include <stdio.h> #include <string.h> int a[310][31
·
2015-10-21 10:31
array
29.
Palindrome
Number
Determinewhetheranintegerisa
palindrome
.
u010339647
·
2015-10-20 11:00
uva10739(String to
Palindrome
)
思路:题目说的是给定一个字符串,然后可以对每个字符修改一次,问最少需要修改多少吃可以使得字符串变成回文字符串。这题的状态显然是很好像的dp[i][j]表示区间[i,j]的字符串修改成回文的需要修改的最少次数,然后就是转移方程了。1,s[i]=s[j],dp[i][j]=dp[i+1][j-1];2,s[i]!=s[j],显然此事需要修改一次,看是修改s[i]还是修改s[j],修改s[i]的话就是d
KIJamesQi
·
2015-10-18 17:00
String
uva
基础dp
Valid
Palindrome
题目名称Valid
Palindrome
—LeetCode链接描述Givenastring,determineifitisa
palindrome
,consideringonlyalphanumericcharactersandignoringcases.Forexample
oNever_say_love
·
2015-10-18 12:00
LeetCode
String
palindrome
Palindrome
(补全回文串+最长公共子序列的应用)hdu1513+poj1159+动态规划
Palindrome
TimeLimit:4000/2000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(
u010579068
·
2015-10-17 21:00
动态规划
palindrome
最长公共子序列的应用
hdu1513
poj1159
*LeetCode-
Palindrome
Permutation
更方便就是每次假如已经有了就remove没有就add这样保证一对一对的都已经remove了最后set剩下一个或者没有剩下的话就是对的publicclassSolution{ publicbooleancanPermute
Palindrome
bsbcarter
·
2015-10-17 01:00
LeetCode --
Palindrome
Partitioning
题目描述:Givenastrings,partitionssuchthateverysubstringofthepartitionisa
palindrome
.Returnallpossible
palindrome
partitioningofs.Forexample
csharp25
·
2015-10-17 00:00
Palindrome
Number
题目名称
Palindrome
Number—LeetCode链接描述Determinewhetheranintegerisa
palindrome
.Dothiswithoutextraspace.分析判断一个数是否为回文数
oNever_say_love
·
2015-10-15 10:00
C++
数据类型转换
回文数
sstream
【练习题】编写一个名为is_
palindrome
的函数,判断一个人名是否为回文,如‘BOB’是回文
#编写一个名为is_
palindrome
的函数,判断一个人名是否为回文,如‘BOB’是回文#方法一:defis_
palindrome
(name):low=0high=len(name)-1whilelow
-兔纸-
·
2015-10-14 20:06
LeetCode刷题记录
MedianofTwoSortedArrays5.LongestPalindromicSubstring6.ZigZagConversion7.ReverseInteger8.StringtoInteger(atoi)9.
Palindrome
Number10
YRB
·
2015-10-10 22:00
LeetCode --
Palindrome
Linked List
题目描述:Givenasinglylinkedlist,determineifitisa
palindrome
.Followup:CouldyoudoitinO(n)timeandO(1)space?
csharp25
·
2015-10-10 19:00
[LeetCode-234]
Palindrome
Linked List(回文链表、链表中间节点查找)
Givenasinglylinkedlist,determineifitisa
palindrome
.Followup:CouldyoudoitinO(n)timeandO(1)space?
xy010902100449
·
2015-10-08 21:00
LeetCode
[LeetCode]
Palindrome
Number
Determinewhetheranintegerisa
palindrome
.Dothiswithoutextraspace.Somehints:Couldnegativeintegersbe
palindrome
s
hnxijie
·
2015-10-08 18:00
找出s的子串中字典序第k小的“半回文串” Trie Codeforce Div. 2 Ann and Half-
Palindrome
http://codeforces.com/problemset/problem/557/E题意找出s的子串中字典序第k小的“半回文串”,给出半回文串定义是:对于任意i=4),其他的都是奇回文串;要输出第k个字典序的子串,首先肯定想到要用字典树输出来就是了,很简单的dfs就可以了。插入串的时候,就不要一个一个插了,而直接插一个后缀就可以了这样总的复杂度也就是O(n*n),n是串的长度。http:/
詹明捷
·
2015-10-07 18:49
Trie
最长回文子串
注意Longest
Palindrome
2中的实现技巧。先寻找当前字符相同的字符,并且更新index,从而提高效率。
u013819100
·
2015-10-07 10:00
最长回文子串
manacher算法
上一页
73
74
75
76
77
78
79
80
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他