/*
CF410div2 A. Mike and palindrome
http://codeforces.com/contest/798/problem/A
水题
*/
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <vector>
#include <queue>
#include <iostream>
#include <map>
#include <set>
//#define test
using namespace std;
const int Nmax=1e6+;
char s[];
char tmp[];
int n;
int check()
{
for(int i=;i<n;i++)
if(s[i]!=s[n-i-])
return ;
return ;
}
int main()
{
#ifdef test
#endif
scanf("%s",tmp);
n=strlen(tmp);
int flag=;
for(int i=;i<n;i++)
s[i]=tmp[i];
if(n&)
{
if(check())
{
printf("YES\n");
return ;
}
}
for(int i=;i<n;i++)
{
for(int j=;j<n;j++)
s[j]=tmp[j];
if(s[i]==s[n-i-])
continue;
else
{
s[i]=s[n-i-];
if(check())
flag=;
}
}
if(flag)
printf("YES\n");
else
printf("NO\n");
return ;
}

CF410div2 A. Mike and palindrome的更多相关文章

  1. Codeforces 798A - Mike and palindrome

    A. Mike and palindrome time limit per test 2 seconds memory limit per test 256 megabytes input stand ...

  2. Codeforces Round #410 (Div. 2) A. Mike and palindrome

    A. Mike and palindrome time limit per test 2 seconds memory limit per test 256 megabytes input stand ...

  3. CF410div2 B. Mike and strings

    /* CF410div2 B. Mike and strings http://codeforces.com/contest/798/problem/B 字符串 暴力 题意:给你n个串,每次操作可以将 ...

  4. CF410div2 D. Mike and distribution

    /* CF410div2 D. Mike and distribution http://codeforces.com/contest/798/problem/D 构造 题意:给出两个数列a,b,求选 ...

  5. Codeforces Round #410 (Div. 2) A. Mike and palindrome【判断能否只修改一个字符使其变成回文串】

    A. Mike and palindrome time limit per test 2 seconds memory limit per test 256 megabytes input stand ...

  6. Mike and palindrome CodeForces - 798A

    题目链接 一个简单的题目,但是却很少有人可以一次AC,比如我就瞎写wa了一次... 写本博算个教训录吧. 题目给出一个字符串,让你严格的改变一个字符使改变后的字符串是一个回文串. 回文串不用解释了.不 ...

  7. 【codeforces 798A】Mike and palindrome

    [题目链接]:http://codeforces.com/contest/798/problem/A [题意] 让你严格改变一个字符,使得改变后的字符串为一个回文串; 让你输出可不可能; [题解] 直 ...

  8. Codeforces Round #410 (Div. 2)(A,字符串,水坑,B,暴力枚举,C,思维题,D,区间贪心)

    A. Mike and palindrome time limit per test:2 seconds memory limit per test:256 megabytes input:stand ...

  9. Codeforces Round #410 (Div. 2)A B C D 暴力 暴力 思路 姿势/随机

    A. Mike and palindrome time limit per test 2 seconds memory limit per test 256 megabytes input stand ...

随机推荐

  1. C. Searching for Graph(cf)

    C. Searching for Graph time limit per test 1 second memory limit per test 256 megabytes input standa ...

  2. js获取后台数据

    <!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>& ...

  3. codevs地鼠游戏(贪心)

    1052 地鼠游戏  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 钻石 Diamond   题目描述 Description 王钢是一名学习成绩优异的学生,在平时的学习中,他 ...

  4. codevs1369 xth 砍树(线段树)

    1369 xth 砍树  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 钻石 Diamond     题目描述 Description 在一个凉爽的夏夜,xth 和 rabbi ...

  5. ajax 以json 的形式来传递返回参数的实例

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestWcf.aspx.c ...

  6. cocos creator学习

    2019-05-30 22:23:27 按照前一节我发的教程做,大概了解了Cocos creator的基本布局 但是你发现你不好写代码(感觉视频没有提) 需要下载VS code软件,在其上进行编辑,教 ...

  7. python自动化测试学习笔记-1

    一.什么是自动化 自动化测试是把以人为驱动的测试行为转化为机器执行的一种过程.直白的就是为了节省人力.时间或硬件资源,提高测试效率,便引入了通过软件或程序自动化执行测试用例进行测试: 二.python ...

  8. AdminLTE介绍和zTree的简单使用

    一.AdminLTE介绍 1.介绍 ​ AdminLTE是一个开源的后台控制面板和仪表盘 WebApp 模板,是建立在Bootstrap3框架和JQuery之上的开源模板主题工具,它提供了一系列响应的 ...

  9. Spring.net(v1.3.2) 官网API-第一章 前言

    虽然有很好的工具和技术,但是开发软件应用仍然是很困难的.Spring为构建企业级应用提供了一个轻量级的解决方案,Spring提供了一个统一的.透明的方式去配置你的应用,和将AOP集成到你的软件中.Sp ...

  10. mysql之数据去重并记录总数

    引用: http://blog.sina.com.cn/s/blog_6c9d65a10101bkgk.htmlhttp://www.jb51.net/article/39302.htm 1.使用di ...