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
Palindromes
Queries for Number of
Palindromes
http://codeforces.com/contest/245/problem/H 代码及其注释: #include<iostream> #include<stdio.h> #include<string.h> #include<math.h> #include<algorithm> #include<vecto
·
2015-11-13 12:54
number
USACO Section 1.2: Dual
Palindromes
1 /* 2 ID: leetcod3 3 PROG: dualpal 4 LANG: C++ 5 */ 6 #include <iostream> 7 #include <fstream> 8 #include <string> 9 #include <map> 10 #include <vector>
·
2015-11-13 11:04
USACO
【UVa】Partitioning by
Palindromes
(dp)
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=27&page=show_problem&problem=2549 设w[i,j]为i-j能分割成的最少回文串 f[i]为前i个字符能够分成的最少回文串 w[i,j]=1 当w[i+1,j-1]==1 &a
·
2015-11-13 11:07
partition
USACO Section 1.5: Prime
Palindromes
这题的关键点: 1.不能检查是否palindrome,否则会TLE 2.检查Prime上限一定为sqrt(x)。 1 /* 2 ID: leetcod3 3 PROG: pprime 4 LANG: C++ 5 */ 6 #include <iostream> 7 #include <fstream> 8 #include <st
·
2015-11-13 10:04
USACO
Palindromes
and Super Abilities
http://acm.timus.ru/problem.aspx?space=1&num=1960 题意:给一个串s,要求输出所有的s[0]~s[i],i<|s|的回文串数目。(|s|<=10^5) #include <bits/stdc++.h> using namespace std; struct PT { static const int nS
·
2015-11-13 08:58
super
leetcode第九题--Palindrome Number
Some hints: Could negative integers be
palindromes
? (ie, -1) If you are thinking of co
·
2015-11-13 08:32
LeetCode
1054-回文回文!
英语中单词
Palindromes
指顺读倒读都一样的词语,比如radar,reviver,repaper,deified,rotator。
·
2015-11-13 08:35
回文
11151 - Longest Palindrome
For example, I, GAG and MADAM are
palindromes
·
2015-11-13 07:30
long
[LeetCode]Palindrome Number
Some hints: Could negative integers be
palindromes
? (ie, -1) If you are thinking of converting t
·
2015-11-13 07:18
LeetCode
CC 3-
Palindromes
(manacher)
传送门:3-
Palindromes
题意:求为回文串且能整除3且不前导0的子串个数。
·
2015-11-13 04:33
ROM
9. Palindrome Number
Some hints: Could negative integers be
palindromes
? (ie, -1) If you are thinking of converti
·
2015-11-13 03:32
number
hoj 1004 Prime
Palindromes
回文素数
/* 晕,弄少了九位数的那段 据说偶数位的话,除了11是回文素数以外,其他均可被11整除并且是合数, 然后就枚举1位3位5位7位9位数的数,然后判断是否为素数即可 */ #include <iostream> #include <cmath> using namespace std; long long a,b; bool judge(long long
·
2015-11-13 03:12
Prim
USACO Section1.5 Prime
Palindromes
解题报告
pprime解题报告 —— icedream61 博客园(转载请注明出处)------------------------------------------------------------------------------------------------------------------------------------------------【题目】 求a
·
2015-11-13 01:05
USACO
USACO Section1.2 Dual
Palindromes
解题报告
dualpal解题报告 —— icedream61 博客园(转载请注明出处)------------------------------------------------------------------------------------------------------------------------------------------------【题目】 给
·
2015-11-13 01:58
USACO
UVA 401-
Palindromes
这是一道关于回文字符串的题,但是加上了镜像,我用了两个函数分别判断一个字符串是不是回文 和镜像,然后用两个flag,最后根据题目的要求来输出结果。 #include<stdio.h>#include<string.h>#include<ctype.h>char *ch = "A 3 HIL JM O 2TUVWXY5";cha
·
2015-11-13 01:32
ROM
USACO 1.2 Dual
Palindromes
Dual
Palindromes
Mario Cruz (Colombia) & Hugo Rickeboer (Argentina) A number that reads the
·
2015-11-13 00:07
USACO
USACO 1.2 Palindromic Squares
Palindromic Squares Rob Kolstad
Palindromes
are numbers that read the same forwards as backwards.
·
2015-11-13 00:06
USACO
Mnemonics and
Palindromes
(DP)
链接 先初始化一下所有的回文串 再O(n*n)DP 输出路径dfs 刚开始存所有回文 ME了 后来发现用不着 改了改了OK了 数据还挺强 1 #include <iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include<algorithm> 5 #
·
2015-11-13 00:28
ROM
LeetCode_Palindrome Number
Some hints: Could negative integers be
palindromes
?
·
2015-11-12 23:10
LeetCode
LeetCode Problem 9:Palindrome Number回文数
Some hints: Could negative integers be
palindromes
?
·
2015-11-12 23:07
LeetCode
Java [leetcode 9] Palindrome Number
Some hints: Could negative integers be
palindromes
?
·
2015-11-12 22:50
LeetCode
USACO Calf Flac
heavy-duty laptops (with very large keys), that they will ultimately produce all the world's great
palindromes
·
2015-11-12 19:21
USACO
leetcode--Palindrome Number
Some hints: Could negative integers be
palindromes
?
·
2015-11-12 17:31
LeetCode
UVA 11584 Partitioning by
Palindromes
动态规划 入门
这个题目的大意就是,给你一个字符串,然后让你求出最少的回文数。我开始傻逼了,写了一个o(n^3)的算法,结果老超时。然后略看了别人的题解,才知道有个如此的转移方程。 f[i+1]=min(f[j]+1,其中j~i是回文),基础的动态规划题目,还得多多加强训练。 #include<iostream> #include<cstdio> #include<cstring
·
2015-11-12 16:37
partition
UVA 11584 Partitioning by
Palindromes
题意:把字符串划分成尽量少的回文串。 dp[i] = max{dp[j-1] + 1 | str[j....i]为回文串}。 View Code 1 /* 2 Author:Zhaofa Fang 3 Lang:C++ 4 */ 5 #include <cstdio> 6 #include <cstdlib> 7 #include &
·
2015-11-12 16:45
partition
No to
Palindromes
!
http://codeforces.com/contest/465/problem/C 题意:给你一个字符串,然后按照字典序找出下一个字符串,这个字符串中不能含有长度大于等于2的子串为回文串,如果含有输出,否则输出NO; 思路:判断回文串时只需判断要修改的i位置,i+1位置和i+2位置是不是与这个要修改的字符相等。字符串的前缀不含有回文子字符串,改变i位后也不会含有。 1 #inc
·
2015-11-12 16:35
codeforces
Palindrome Number
Some hints: Could negative integers be
palindromes
? (ie, -1) If you are thinking of converting t
·
2015-11-12 16:55
number
UVA 401 -
Palindromes
这道题憋了好久,题很简单,错在了输出格式:每行之间有空格 judge后wrong answer,值得注意。 #include<stdio.h>#include<string.h>char s[25];int palin(char* s){ int len = strlen(s); for(int i = 0; i < len/2; i ++)
·
2015-11-12 15:26
ROM
Palindrome Number
Some hints: Could negative integers be
palindromes
?
·
2015-11-12 14:35
number
Prime
Palindromes
题目大意:求出区间[a,b]之间的回文质数。 a<=b<=10^8; 解题过程: 1.先打个素数表,新学了个 欧拉筛法,是对普通筛法的改进。普通筛法是每找到一个素数,就把它的所有倍数标记成1,那么对于一个合数,它会被它的所有质因数标记一次。那么就浪费了时间(复杂度O(NloglogN))。欧拉筛法的复杂度可以降到O(N), 它的优化在于 找到一个质数的时候,把所有
·
2015-11-12 14:28
Prim
usaco1.52Prime
Palindromes
dfs搜前5位数 根据前面的算后面的 View Code 1 /* 2 ID: your_id_here 3 PROG: pprime 4 LANG: C++ 5 */ 6 #include <iostream> 7 #include<cstdio> 8 #include<cstring>
·
2015-11-12 14:48
USACO
USACO1.24Calf Flac
heavy-duty laptops (with very large keys), that they will ultimately produce all the world's great
palindromes
·
2015-11-12 14:29
USACO
USACO 1.5 Prime
Palindromes
(枚举)
本来想筛选素数的。。。交了之后发现复杂度也太高了。。。可耻的看了一下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
Palindromes
跟上一个题基本差不多,题目是不是有歧义啊。。。这个题的意思是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
USACO1.5.2--Prime
Palindromes
Prime
Palindromes
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
palindromes
·
2015-11-12 11:53
USACO
ytu 1940:
Palindromes
_easy version(水题)
Palindromes
_easy version Time Limit: 1 Sec Memory Limit: 64 MB Submit:
·
2015-11-12 10:10
version
Dual
Palindromes
Dual
Palindromes
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
Palindromes
are numbers that read the same forwards as backwards.
·
2015-11-12 09:15
USACO
uva 11584 Partitioning by
Palindromes
紫皮书! 题意:给你小写字母组成的字符串,让你划分为尽量少的回文串。 思路: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
Some hints: Could negative integers be
palindromes
? (ie, -1) If you are thinking of converting t
·
2015-11-11 18:57
number
UVA401 -
Palindromes
判断回文串 与 镜像对称的串 主要是要用常量简化代码 见代码 #include <iostream> #include <algorithm> #include <string> #include <cstdio> #include <cstring> #include <cstdlib> #in
·
2015-11-11 18:27
ROM
回文串+回溯法 URAL 1635 Mnemonics and
Palindromes
题目传送门 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
Codeforces245H - Queries for Number of
Palindromes
(区间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
UVa11584 - Partitioning by
Palindromes
(区间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
Palindromes
Dual
Palindromes
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
Palindromes
are numbers that read the same forwards as backwards.
·
2015-11-11 17:56
USACO
uva 401
Palindromes
#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
Palindrome Number
Some hints: Could negative integers be
palindromes
? (ie, -1) If you are thinking of converting t
·
2015-11-11 15:36
number
【LeetCode】9 - Palindrome Number
Some hints: Could negative integers be
palindromes
?
·
2015-11-11 14:16
LeetCode
上一页
2
3
4
5
6
7
8
9
下一页
按字母分类:
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
其他