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
USACO 1.5 Prime
Palindrome
s(枚举)
本来想筛选素数的。。。交了之后发现复杂度也太高了。。。可耻的看了一下hint,然后就各种for枚举了每一位了。.。 1 /* 2 ID: cuizhe 3 LANG: C++ 4 TASK: pprime 5 */ 6 #include <cstdio> 7 #include <cstring> 8 #include <
·
2015-11-12 13:00
USACO
USACO 1.2 Dual
Palindrome
s
跟上一个题基本差不多,题目是不是有歧义啊。。。这个题的意思是2-10进制中至少在两个进制上是回文的,理解错了题意挂了一次。。。 1 /* 2 ID: cuizhe 3 LANG: C++ 4 TASK: dualpal 5 */ 6 #include <iostream> 7 #include <cstdio> 8 #include <
·
2015-11-12 13:50
USACO
[HDU 4632]
Palindrome
subsequence
Palindrome
subsequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072
·
2015-11-12 12:27
sequence
LeetCode - Valid
Palindrome
Given a string, determine if it is a
palindrome
, considering only alphanumeric characters and ignoring
·
2015-11-12 12:31
LeetCode
The Problem to Slow Down You(Palindromic Tree)
题目链接:http://codeforces.com/gym/100548 今天晚上突然有了些兴致去学习一下数据结构,然后就各种无意中看到了
Palindrome
Tree的数据结构,据说是2014年新出的数据结构
·
2015-11-12 12:01
tree
[LeetCode][Python]
Palindrome
Number
# -*- coding: utf8 -*-'''__author__ = '
[email protected]
'https://oj.leetcode.com/problems/
palindrome
-number
·
2015-11-12 11:38
LeetCode
USACO1.5.2--Prime
Palindrome
s
Prime
Palindrome
s The number 151 is a prime
palindrome
because it is both a prime number and a
palindrome
·
2015-11-12 11:58
USACO
USACO1.3.3--Calf Flac
heavy-duty laptops (with very large keys), that they will ultimately produce all the world's great
palindrome
s
·
2015-11-12 11:53
USACO
ytu 1940:
Palindrome
s _easy version(水题)
Palindrome
s _easy version Time Limit: 1 Sec Memory Limit: 64 MB Submit:
·
2015-11-12 10:10
version
poj 3280 Cheapest
Palindrome
(区间DP)
Cheapest
Palindrome
Time Limit: 2000MS Memory Limit: 65536K Total Submissions
·
2015-11-12 10:29
heap
Dual
Palindrome
s
Dual
Palindrome
s Mario Cruz (Colombia) & Hugo Rickeboer (Argentina) A number that reads the same
·
2015-11-12 09:16
dual
USACO1.23Palindromic Squares
Palindromic Squares Rob Kolstad
Palindrome
s are numbers that read the same forwards as backwards.
·
2015-11-12 09:15
USACO
poj1159
Palindrome
(最长公共子序列)
http://poj.org/problem?id=1159 这题以前见过 不会 今天做比赛又看到 知道自己不会 就没多想 后来CZ说是水题 最长公共子序列 我就开始想 想到求正序和逆序的最长公共子序列 不知道对不对 就自己想了几个数据试了一下 都过了 就交了 还真蒙对了 ME了一次 又现学的滚动数组 View Code 1 #include <iostream>
·
2015-11-12 09:12
poj
Valid
Palindrome
Given a string, determine if it is a
palindrome
, considering only alphanumeric characters and ignoring
·
2015-11-12 09:52
ROM
Palindrome
Partitioning II 改进
Given a string s, partition s such that every substring of the partition is a
palindrome
·
2015-11-12 09:42
partition
Palindrome
Partitioning II
Given a string s, partition s such that every substring of the partition is a
palindrome
·
2015-11-12 09:41
partition
uva 10453 - Make
Palindrome
(dp)
题目链接:10453 - Make
Palindrome
题目大意:给出一个字符串,通过插入字符使得原字符串变成一个回文串,要求插入的字符个数最小,并且输出最后生成的回文串。
·
2015-11-12 09:47
Make
[LeetCode125]Valid
Palindrome
题目来源:https://leetcode.com/problems/valid-
palindrome
/ 原题地址Givenastring,determineifitisa
palindrome
,consideringonlyalphanumericcharactersandignoringcases.Forexample
hnxijie
·
2015-11-11 21:00
uva 11584 Partitioning by
Palindrome
s
紫皮书! 题意:给你小写字母组成的字符串,让你划分为尽量少的回文串。 思路:dp[i] 为0 - i 划分的最小的回文串的个数 则 dp[i] = min{dp[i],dp[j]+1} 如果 j+1 到 i 是回文串的话 (PS: 是 j+1 到 i 是回文串 而不是 j 到 i 是回文串) 先把 从 i - j 是回文串 处理一下然后dp 总之水题…… #include <io
·
2015-11-11 19:28
partition
Palindrome
Number
Determine whether an integer is a
palindrome
. Do this without extra space.
·
2015-11-11 18:57
number
hdu - 4632 -
Palindrome
subsequence
题意:求一个给定字符串的回文子串个数(字符串长度 <= 1000,共T(T <= 50)组测试数据,不同位置的相同回文串算不同的)。 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4632 ——>>设d[i][j]表示区间[i, j]内的回文子串个数, 状态转移方程:d[i][j] = (d[i+1][j] + d[i]
·
2015-11-11 18:53
sequence
UVA401 -
Palindrome
s
判断回文串 与 镜像对称的串 主要是要用常量简化代码 见代码 #include <iostream> #include <algorithm> #include <string> #include <cstdio> #include <cstring> #include <cstdlib> #in
·
2015-11-11 18:27
ROM
回文串+回溯法 URAL 1635 Mnemonics and
Palindrome
s
题目传送门 1 /* 2 题意:给出一个长为n的仅由小写英文字母组成的字符串,求它的回文串划分的元素的最小个数,并按顺序输出此划分方案 3 回文串+回溯:dp[i] 表示前i+1个字符(从0开始)最少需要划分的数量,最大值是i+1,即单个回文串; 4 之前设置ok[j][j+i] 判断从j到j+i的字符是否为回文串(注意两个for的顺序,为满足ok[j][j+i]
·
2015-11-11 18:04
ROM
LCS(滚动数组) POJ 1159
Palindrome
题目传送门 1 /* 2 LCS裸题:长度减去最大相同长度就是要插入的个数 3 dp数组二维都开5000的话就会超内存,这里就用到了滚动数组, 4 因为在LCS的计算中,i的变化只相差1,所以可以通过对2取余来进行滚动:) 5 */ 6 #include <cstdio> 7 #include <iostream> 8 #inclu
·
2015-11-11 18:43
poj
LCS POJ 1159
Palindrome
题目传送门 1 /* 2 LCS裸题:长度减去最大相同长度就是要插入的个数 3 */ 4 #include <cstdio> 5 #include <iostream> 6 #include <cstring> 7 #include <algorithm> 8 #include <string> 9
·
2015-11-11 18:42
poj
Palindrome
pairs
题目地址:http://blog.csdn.net/shiyuankongbu/article/details/10004443 1 /* 2 题意:在i前面找回文子串,在i后面找回文子串相互配对,问有几对 3 DP:很巧妙的从i出发向两头扩展判断是否相同来找回文串 4 dpr[i] 代表记录从0到i间的回文子串的个数,dpl[i] 代表记录i之后的回文子串个数
·
2015-11-11 18:03
round
poj
Palindrome
(LCS)
http://poj.org/problem?id=1159 题意:给一个长度为n的串,求将其变成回文要增加的最少字符数. 思路:LCS算法:状态方程:if(a[i]==b[j]) ans[i][j]=max1(ans[i-1][j-1]+1,ans
·
2015-11-11 17:53
poj
Codeforces335B -
Palindrome
(区间DP)
题目大意 给定一个长度不超过5*10^4的只包含小写字母的字符串,要求你求它的回文子序列,如果存在长度为100的回文子序列,那么只要输出长度为一百的回文子序列即可,否则输出它的最长回文子序列 题解 这个题很考验思维~~~相当不错的题,想到了就很简单,其实也就是充分利用题设。n的规模为5*10^4,如果不进行一些处理直接上O(n^2)算法肯定会超时,但是题目里有个很重要的条件,那就是如果存在长度
·
2015-11-11 17:42
codeforces
Codeforces245H - Queries for Number of
Palindrome
s(区间DP)
题目大意 给定一个字符串s,q个查询,每次查询返回s[l…r]含有的回文子串个数(题目地址) 题解 和有一次多校的题目长得好相似,这个是回文子串个数,多校的是回文子序列个数 用dp[i][j]表示,s[i..j]含有的回文子串个数,则dp[i][j]=dp[i][j-1]+dp[i+1][j]-dp[i+1][j-1]+flag[i][j](如果s[i..j]是回文子串则flag[i][j]
·
2015-11-11 17:34
codeforces
POJ1159 -
Palindrome
(区间DP)
题目大意 给定一个字符串S,问最少插入多少个字符可以使字符串S变为回文串 题解 用dp[i][j]表示把字符串s[i…j]变为回文串需要插入的最小字符数 如果s[i]==s[j]那么dp[i][j]=dp[i+1][j-1] 如果s[i]!=s[j]那么dp[i][j]=min(dp[i+1][j],dp[i][j-1])+1 可以用滚动数组优化一下空间 代码: #include&l
·
2015-11-11 17:33
poj
POJ3280 - Cheapest
Palindrome
(区间DP)
题目大意 给定一个字符串,要求你通过插入和删除操作把它变为回文串,对于每个字符的插入和删除都有一个花费,问你把字符串变为回文串最少需要多少花费 题解 看懂题立马YY了个方程,敲完就交了,然后就A了,爽歪歪,哈哈~~~ dp[i][j]表示把s[i..j]变为回文的最小花费,设cost[0][ch-‘a’]和cost[1][ch-‘a’]分别为插入字符ch和删除字符ch的花费 如果s[i]=
·
2015-11-11 17:29
heap
UVa11584 - Partitioning by
Palindrome
s(区间DP)
题目大意 给定一个小写字母组成的字符串S,你的任务是划分成尽量少的回文串 题解 方程就是dp[j]=min(dp[i-1]+1)(i<=j,s[i..j]是回文串) 代码: #include<iostream> #include<algorithm> #include<cstdio> #include<cstring> usin
·
2015-11-11 17:27
partition
USACO1.2.5--Dual
Palindrome
s
Dual
Palindrome
s Mario Cruz (Colombia) & Hugo Rickeboer (Argentina) A number that reads the
·
2015-11-11 17:57
USACO
USACO1.2.4--Palindromic Squares
Palindromic Squares Rob Kolstad
Palindrome
s are numbers that read the same forwards as backwards.
·
2015-11-11 17:56
USACO
uva 401
Palindrome
s
#include<iostream>、 #include<cctype> using namespace std; int main(){ char a[36] = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X',
·
2015-11-11 17:05
ROM
poj 3280 Cheapest
Palindrome
最优子结构,动态规划
对于 串 Str(I,J)构成 回文串, 一,其可以由 子串Str(I+1,J)构成的回文串 D(I+1,J) 再通过在最右添加字符S(I)构成 二,也可以由 字串Str(I, J-1)构成的回文串 D(I, J-1) 再通过在最左边添加字符 S(J)构成 三,当 S(I) == S(J)时,两个边界不花费总是最优,我们可以由 子串Str(I+1,J
·
2015-11-11 17:13
动态规划
009 -
Palindrome
Number
Determinewhetheranintegerisa
palindrome
.Dothiswithoutextraspace.判断回文数字boolis
Palindrome
(intx){ inty=0;
shuimuyq
·
2015-11-11 16:00
hdu_5146
1 #include "cstdio" 2 3 #define MaxN 1111 4 #define ACCEPT 5 6 bool is_
palindrome
·
2015-11-11 16:37
HDU
POJ各题算法分类
1037 A decorative fence、1050 To the Max、1088 滑雪、1125 Stockbroker Grapevine、1141 Brackets Sequence、1159
Palindrome
·
2015-11-11 16:11
poj
Palindrome
Partitioning
Given a string s, partition s such that every substring of the partition is a
palindrome
·
2015-11-11 15:30
partition
Palindrome
Partitioning II
Given a string s, partition s such that every substring of the partition is a
palindrome
·
2015-11-11 15:29
partition
Palindrome
Number
Determine whether an integer is a
palindrome
. Do this without extra space.
·
2015-11-11 15:36
number
10453 Make
Palindrome
(dp)
Problem A Make
Palindrome
Input: standard input Output: standard output Time Limit
·
2015-11-11 15:32
Make
[leetcode]
Palindrome
Partitioning II
就是预处理是否是
Palindrome
的boolean[][],话费O(n^3)。
·
2015-11-11 14:35
partition
10453 Make
Palindrome
(dp)
Problem A Make
Palindrome
Input: standard input Output: standard output Time Limit
·
2015-11-11 14:08
Make
【LeetCode】9 -
Palindrome
Number
Determine whether an integer is a
palindrome
. Do this without extra space.
·
2015-11-11 14:16
LeetCode
zoj 2744
Palindrome
s
Palindrome
s Time Limit: 1 Second Memory Limit: 32768 KB A regular
palindrome
·
2015-11-11 13:01
ROM
Palindrome
Partitioning II
Given a string s, partition s such that every substring of the partition is a
palindrome
·
2015-11-11 13:30
partition
Palindrome
Partitioning
Given a string s, partition s such that every substring of the partition is a
palindrome
·
2015-11-11 13:30
partition
Valid
Palindrome
Given a string, determine if it is a
palindrome
, considering only alphanumeric characters and ignoring
·
2015-11-11 13:25
ROM
上一页
66
67
68
69
70
71
72
73
下一页
按字母分类:
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
其他