原题链接:http://ac.jobdu.com/problem.php?pid=1528 
小白书上的做法,不过这个还要简单些。。。

 #include<algorithm>
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<cstdio>
using std::max;
const int Max_N = ;
char ret[Max_N];
void solve() {
int i, j, ans = , n = strlen(ret);
for (i = ; i < n; i++) {
for (j = ; i >= j && i + j < n; j++) {
if (ret[i - j] != ret[i + j]) break;
ans = max(ans, j << | );
}
for (j = ; i >= j && i + j + < n; j++) {
if (ret[i - j] != ret[i + j + ]) break;
ans = max(ans, (j << ) + );
}
}
printf("%d\n", ans);
}
int main() {
#ifdef LOCAL
freopen("in.txt", "r", stdin);
freopen("out.txt", "w+", stdout);
#endif
while (gets(ret)) solve();
return ;
}

最新文章

  1. Windows Live Writer测试
  2. 【Ngui 学习系列之一:简单组件的操作】
  3. 跨过几个坑,终于完成了我的第一个Xamarin Android App!
  4. Session和Cookie的作用以及实现
  5. Unity3D热更新全书-脚本(四) 用C#LightEvil搭建实际开发使用的脚本框架
  6. Scrum Meeting 10-20151216
  7. 简单翻译和补充:1. GNU ARM Eclipse
  8. javascript--自己用的插件
  9. Quartz.net Cron表达式
  10. [转]laravel 4之视图及Responses
  11. JSON 数组格式
  12. Elasticsearch 5.0 安装 Search Guard 5 插件 (五)
  13. oracle索引
  14. 爬虫之爬取网贷之家在档P2P平台基本数据并存入数据库
  15. 回归模型效果评估系列1-QQ图
  16. [Swift]LeetCode266.回文全排列 $ Palindrome Permutation
  17. CF809E Surprise me!(莫比乌斯反演+Dp(乱搞?))
  18. IOS 数据存储之 FMDB 详解
  19. &quot;add-apt-repository&quot; On Linux
  20. Python&amp;Appium实现安卓手机图形解锁

热门文章

  1. Django中级篇(上)
  2. js实现简单的滑动门和tab选项卡
  3. No.006 ZigZag Conversion
  4. Unieap3.5错误收集
  5. HTML框架标签
  6. php实现文件上传的源码
  7. Jetson TK1 Restore 步骤
  8. js事件 event.target
  9. Objective-C介绍
  10. PHP数组操作大全