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
Facebook 第一轮面试题
第一题:leetcode原题:Valid
Palindrome
https://leetcode.com/probl
·
2015-11-11 13:00
Facebook
Palindrome
Partitioning II
Given a string s, partition s such that every substring of the partition is a
palindrome
·
2015-11-11 13:58
partition
Palindrome
Partitioning
Given a string s, partition s such that every substring of the partition is a
palindrome
·
2015-11-11 13:57
partition
Palindrome
(最长公共子序列)
Limit: 65536K Total Submissions: 48526 Accepted: 16674 Description A
palindrome
·
2015-11-11 12:31
ROM
csu 1102
Palindrome
(当然,思路是大牛的)找出反转串与原串的最长公共子列(不连续),然后总长度减去这个LCS的长度即可; dp,空间优化是显然可以的,但是……先AC了再说。。; 3WA:题目要求大小写是distinct,没有仔细读题就想当然地把大写转为小写了; 求c[i][j]时,比较的是x[i-1]与y[j-1]; 将c定义为字符型数组,显然通不过,字符型最
·
2015-11-11 12:16
ROM
Palindrome
s
几个测试: 1 NOTA
PALINDROME
-- is not a
palindrome
. 2 3 ISAPALINILAPASI -- is a regular
palindrome
. 4
·
2015-11-11 12:03
ROM
Leetcode: Valid
Palindrome
Given a string, determine if it is a
palindrome
, considering only alphanumeric characters and ignoring
·
2015-11-11 12:52
LeetCode
【LeetCode练习题】Valid
Palindrome
Valid
Palindrome
Given a string, determine if it is a
palindrome
, considering only alphanumeric
·
2015-11-11 12:23
LeetCode
POJ 3376 Finding
Palindrome
s
题目大意: 给你N个字符串, 你可以两两连接得到N * N个字符串, 问之中回文串的数量. N个字符串的长度和加起来不超过2000000. 简要分析: 无比恶心的题啊... 我们顺次考虑每个字符串放在前面的情况. 假设字符串i放在前面, j放在后面, 那么这个串是回文有两种情况: 1) 若i的长度小于j, 则i是j反串的前缀, 且j反串剩下的后缀是回文串. 2) 若i的
·
2015-11-11 11:09
find
acdream 1019:
Palindrome
字符串多项式取Hash值
1019:
Palindrome
Time Limit: 1 Sec Memory Limit: 128 MB Description Now
·
2015-11-11 11:07
hash
四道简单DP
according to two point's distance to recurrence class Solution: # @return a string def longest
Palindrome
·
2015-11-11 11:44
dp
Palindrome
Partitioning II
Given a string s, partition s such that every substring of the partition is a
palindrome
·
2015-11-11 11:50
partition
Palindrome
Partitioning
Given a string s, partition s such that every substring of the partition is a
palindrome
·
2015-11-11 11:34
partition
Palindrome
Number
Determine whether an integer is a
palindrome
. Do this without extra space.
·
2015-11-11 10:45
number
LeetCode题解——
Palindrome
Number
代码: 1 class Solution { 2 public: 3 bool is
Palindrome
(int x) { 4 if(x < 0
·
2015-11-11 10:59
LeetCode
HDU 4632
Palindrome
subsequence(DP)
题目链接 做的我很无奈,当时思路很乱,慌乱之中,起了一个想法,可以做,但是需要优化。尼玛,思路跑偏了,自己挖个坑,封榜之后,才从坑里出来,过的队那么多,开始的时候过的那么快,应该就不是用这种扯淡方法做的。 1 表示很无奈,没有想到简单的递推式,搞了一个MLE+TLE的方法。 2 最初版本,多了一个for的复杂度,只要标记一下就好,可是在递归了不好处理,让我折腾了老一会,才弄好。
·
2015-11-11 10:30
sequence
HDU 4618
Palindrome
Sub-Array(DP)
题目链接 我还是图样啊....比赛的时候没敢暴力去搜... 1 #include <cstdio> 2 #include <cstdlib> 3 #include <cstring> 4 #include <map> 5 #include <ctime> 6 #include <cmath> 7
·
2015-11-11 10:22
array
POJ 3280 Cheapest
Palindrome
(DP)
题目链接 被以前的题目惯性思维了,此题dp[i][j],代表i到j这一段变成回文的最小花费。我觉得挺难的理解的。 1 #include <cstdio> 2 #include <cstring> 3 #include <iostream> 4 using namespace std; 5 int dp[2015][2015]; 6 c
·
2015-11-11 10:08
heap
UVA 10453 - Make
Palindrome
(DP)
题目链接 今天多校第一场,我酱油了。。。哎,最近做DP,完全没有感觉啊,这个破题,C RE无数次,用C++过了。。。好假。。 记录路径的本身 和逆序的最长公共子序。 1 #include <stdio.h> 2 #include <string.h> 3 int p[1001][1001]; 4 int main() 5 { 6 cha
·
2015-11-11 10:39
Make
UVA 401 -
Palindrome
s (字符串)
题目链接 无语+ 无奈 10+的错误,看不懂的题意,不懂为何会AC,为神马删了对O和0的判断就AC。。。真受不了。。。 1 #include <stdio.h> 2 #include <string.h> 3 int main() 4 { 5 int i,j,len,x,y; 6 char p[1000],o[1000]; 7
·
2015-11-11 10:43
字符串
POJ 3280 Cheapest
Palindrome
(DP)
题目链接 题意 :给你一个字符串,让你删除或添加某些字母让这个字符串变成回文串,删除或添加某个字母要付出相应的代价,问你变成回文所需要的最小的代价是多少。 思路 :DP[i][j]代表的是 i 到 j 这一段位置变成回文所需的最小的代价。 1 //3280 2 #include <stdio.h> 3 #include <string.h> 4
·
2015-11-11 10:48
heap
POJ1159
Palindrome
http://poj.org/problem?id=1159 题意 : 给定一个字符串,问最少插入多少字符,使该字符串变成回文串 思路 : 设原字符串序为X,逆序列为Y,则最少需要补充的字母数 = X的len减去X和Y的最长公共子序列的长度,又是一个动态规划问题,这个题的数据范围到5000,倒不是说会超时,但是会超内存,在书上看了一个很好的方法就是滚动数组,感觉挺新鲜的,也挺厉害的,但是滚动数
·
2015-11-11 10:10
poj
[leetcode]
Palindrome
Partitioning
相比之下,之后的
Palindrome
Partitioning II那个题目,DP显然更自然。
·
2015-11-11 09:53
partition
判断回文递归算法实现
static bool Is
Palindrome
( string s) { if (num >=
·
2015-11-11 09:03
算法
SGU 327 Yet Another
Palindrome
(状态压缩DP)
题目链接:http://acm.sgu.ru/problem.php?contest=0&problem=327 题意:给出n个字符串。构造一个串s使得s包含n个串以及n个串的反串且这n个串在s中是连续的。求s的最短长度。 思路:设f[i][j][k]表示已经在s中的串的集合为i最后一个串是j(其实是在两端的是j,一个是j的原串一个是j的反串)且前面的是j串的状态是k(k=0表示原串,
·
2015-11-11 09:31
ROM
SGU 325
Palindrome
(贪心)
题目链接:http://acm.sgu.ru/problem.php?contest=0&problem=325 题意:给出一个字符串。每次可以交换相邻的两个字母。问最少需要多少次可以使得串变为回文串? 思路:从左向右扫描。对于每一个字符,找到其对应的字母,将其移到右侧相应的位置。设此时长度为len(每次移动完后长度会减去2),前面已经移动了num个,当前要移动的位置为k,[num+1
·
2015-11-11 09:30
ROM
POJ----(3974 )
Palindrome
[最长回文串]
Time Limit: 15000MS Memory Limit: 65536K Total Submissions: 5121 Accepted: 1834 Description Andy the smart computer science student w
·
2015-11-11 08:36
poj
Palindrome
Degree(Manacer)
题目:http://blog.csdn.net/winddreams/article/details/44218961 求出每一个点为中心的最长字符串,推断该串是不是从开头的回文串。 #include <cstdio> #include <cstring> #include <algorithm> using namespace std
·
2015-11-11 08:41
codeforces
H_Dp
3000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Description A
palindrome
·
2015-11-11 08:00
dp
SRM 600 DIV1
A 按位讨论,取最小值; B 数据范围不大,首先要确定枚举角度; 状压枚举
palindrome
s的列比较科学; 列确定后,目标就是求获得rcnt行的最小代价: dp[i][cnt
·
2015-11-11 08:21
div
[LeetCode]
Palindrome
Number
Determine whether an integer is a
palindrome
. Do this without extra space.
·
2015-11-11 08:03
LeetCode
USACO section1.2 Dual
Palindrome
s
给出 n 和 s (十进制),打印 s 后面 n 个在 2-10 进制中至少两个进制下为回文数的十进制表示。 /* PROG: dualpal LANG: C++ */ # include <cstdio> # include <cstring> int n, s; void strRev(char *s) { char ch;
·
2015-11-11 07:09
USACO
Leetcode:
Palindrome
Partitioning II
Given a string s, partition s such that every substring of the partition is a
palindrome
.
·
2015-11-11 07:00
partition
[cc150] check
palindrome
of a singly linked list
Problem: Implement a function to check if a singly linked list is a
palindrome
.
·
2015-11-11 07:36
check
codeforces Round 286# problem A. Mr. Kitayuta's Gift
You are asked to insert exactly one lowercase English letter into s to make it a
palindrome
·
2015-11-11 07:43
codeforces
LeetCode: Valid
Palindrome
[125]
【题目】 Given a string, determine if it is a
palindrome
, considering only alphanumeric characters
·
2015-11-11 06:42
LeetCode
USACO 1.5 Prime
Palindrome
s
1.生成回文数 (100000000以内)大概20000个 2.判断素数 生成回文数的算法思想: 分别生成数位是奇odd,和数位是偶even的回文数, 对于串1234, 翻转一下 4321,再接上就生成了一个回文数 ,odd:1234321 even:12344321 实现的方法可以多种多样。我用的是递归的方法。 代码 1
·
2015-11-11 05:53
USACO
uva 353 - Pesky
Palindrome
s
// 8ms 2010-05-14 15:09:52 2 // ac(1) 3 // Type: string
Palindrome
s
·
2015-11-11 05:44
ROM
面试题算法分析(2)
public class Solution { public boolean is
Palindrome
(int x) { int a = x, r = 0;
·
2015-11-11 05:12
面试题
[LeetCode]
Palindrome
Number
Determine whether an integer is a
palindrome
. Do this without extra space.
·
2015-11-11 04:08
LeetCode
POJ 2402
Palindrome
Numbers
题目链接 水题,LA我居然没找到在那里。 1 #include <cstdio> 2 #include <cstring> 3 #include <string> 4 #include <cmath> 5 #include <ctime> 6 #include <cstdlib> 7 #incl
·
2015-11-11 04:52
number
Palindrome
(DP)
题目链接 挺好玩的一个题,1Y。。。 1 #include <cstdio> 2 #include <cstring> 3 #include <iostream> 4 using namespace std; 5 int dp[2601][2601]; 6 char s1[50001]; 7 char s2[50001]; 8
·
2015-11-11 04:47
ROM
Mnemonics and
Palindrome
s(DP)
题目链接 本来用区间DP,3次方的复杂度,T了,看了看题解,降维,直接二次方的复杂度可以解。然后折腾一下输出路径。。终于过了。 1 #include <cstring> 2 #include <cstdio> 3 #include <string> 4 #include <iostream> 5 #include <al
·
2015-11-11 04:11
ROM
USACOTrainning.Prime
Palindrome
s
题目大意是给两个整数a,b,然后求出这之间的所有回文素数。 枚举回文的数,其实枚举回文的数加上判断宿舍的时间不是很长的。 1 #include < iostream > 2 #include < string > 3 #include
·
2015-11-11 03:44
USACO
[leetcode]Valid
Palindrome
public class Solution { public boolean is
Palindrome
(String s) { if (s.length() == 0) return
·
2015-11-11 03:56
LeetCode
ural 1297
Palindrome
(Manacher模板题)
转载请注明出处: http://www.cnblogs.com/fraud/ ——by fraud 求最长回文子串。 http://acm.timus.ru/problem.aspx?space=1&num=1297 Manacher模板题
·
2015-11-11 02:20
ROM
Palindrome
Structure(回文)相关的算法实现
palindrome
这个字源自希腊文, 由字首palin - ( 表示back,again ) 加字根drome( 表示run ) 组合而成的, 合起来是runback, 也就是「反过来」的意。
·
2015-11-11 01:56
struct
hdu 4365
Palindrome
graph (规律题 + 快速幂取模 2012 Multi-University Training Contest 7 )
http://acm.hdu.edu.cn/showproblem.php?pid=4365 题意:一个 n*n的 矩阵 ,有m个 格子,已经染色,有 k种颜色可以选 ,,对剩下的格子进行染色,使得 矩阵无论 反转 或者 旋转 90 度 多少次 都不变, 一开思做这道题是,找到了 规律,以为可以 用bool&nb
·
2015-11-11 01:11
Graph
poj 3280 Cheapest
Palindrome
(dp)
http://poj.org/problem?id=3280 又是一道 dp 题目 一开是 有点 小思路,认为他就是括号匹配的变形吗,可是后来,越想月觉的麻烦,(后来才知道 自己 向的太多了,) 一开始 认为他 可以 在任意位置 插入和删除 有一定的费用 ,怎么个dp 法呀,后来看了解题报告 ,确实和 括号匹配一样, 我太菜了。。。。 题意: 一个字符串
·
2015-11-11 01:04
heap
Palindrome
Partitioning——LeetCode
Given a string s, partition s such that every substring of the partition is a
palindrome
·
2015-11-11 01:15
partition
上一页
67
68
69
70
71
72
73
74
下一页
按字母分类:
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
其他