码迷,mamicode.com
首页 >  
搜索关键字:palindromic    ( 595个结果
LeetCode Longest Palindromic Substring
class Solution {private: const char sep_char = '\1';public: string longestPalindrome(string s) { int max_len = 0; int len = s....
分类:其他好文   时间:2014-09-11 01:06:51    阅读次数:265
zoj 3816 Generalized Palindromic Number(暴力枚举)
题目链接:zoj 3816 Generalized Palindromic Number 题目大意:给定n,找一个最大的数x,保证x小于n,并且x为palindromic number 解题思路:枚举前i个放于n相同的数,然后去构造后半部分即可。 #include #include #include using namespace std; typedef unsigned...
分类:其他好文   时间:2014-09-09 13:20:28    阅读次数:131
Longest Palindromic Substring
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longes...
分类:其他好文   时间:2014-09-09 12:14:08    阅读次数:200
ZOJ - 3816 Generalized Palindromic Number dfs
Generalized Palindromic NumberTime Limit: 2 Seconds Memory Limit: 65536 KBA number that will be the same when it is written forwards or backwards i...
分类:其他好文   时间:2014-09-09 11:19:48    阅读次数:351
2014牡丹江网络zoj3816Generalized Palindromic Number(dfs或者bfs)
1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #i...
分类:其他好文   时间:2014-09-09 10:56:58    阅读次数:340
ZOJ - 3816 Generalized Palindromic Number
Description A number that will be the same when it is written forwards or backwards is known as a palindromic number. For example, 1234321 is a palindromic number. We call a number generalized p...
分类:其他好文   时间:2014-09-07 22:31:15    阅读次数:241
zoj 3816 Generalized Palindromic Number (二分+贪心)
题目连接 :http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5348牡丹江网络赛的题,比赛的时候想到做法的,但是一直没调出来,赛后也调了些时间,最近代码能力堪忧啊~有好多做法, 我的做法是二分下界low,即判断在low到n-1之间...
分类:其他好文   时间:2014-09-07 21:07:25    阅读次数:270
ZOJ 3816 Generalized Palindromic Number dfs+暴力枚举
题目链接:点击打开链接 题意: 给定一个数n 找一个最大的数u使得u 枚举前面有多少位是一样的。然后分类讨论。啪啦啪啦 #include #include #include #include #include using namespace std; typedef long long ll; const int N = 22; int pie[N], piesize; ll ...
分类:其他好文   时间:2014-09-07 19:52:35    阅读次数:252
Mudangjiang Online H Generalized Palindromic Number
一开始觉得是数位DP,后来想不出来。 但是感觉爆搜+剪枝可以过,于是就过了。。#include #include #include using namespace std;typedef long long LL;const int maxn = 50;int lim[maxn], len;LL n...
分类:其他好文   时间:2014-09-07 18:32:55    阅读次数:177
[LeetCode] Longest Palindromic Substring
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longes...
分类:其他好文   时间:2014-08-26 19:09:06    阅读次数:153
595条   上一页 1 ... 54 55 56 57 58 ... 60 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!