B. s-palindrome

题目连接:

http://www.codeforces.com/contest/691/problem/B

Description

Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the string "aa" is not. The string "aa" is not "s-palindrome", because the second half of it is not a mirror reflection of the first half.

English alphabet

You are given a string s. Check if the string is "s-palindrome".

Input

The only line contains the string s (1 ≤ |s| ≤ 1000) which consists of only English letters.

Output

Print "TAK" if the string s is "s-palindrome" and "NIE" otherwise.

Sample Input

oXoxoXo

Sample Output

TAK

Hint

题意

给你一个字符串,问你是不是S回文串,是S回文串的话,就必须字母也是镜像的。

题解:

非常有趣。。。

面白い

代码

#include<bits/stdc++.h>
using namespace std;
string a = "AbdHIMOopqTUVvWwXxY";
string b = "AdbHIMOoqpTUVvWwXxY";
bool check(char A,char B){
for(int i=0;i<a.size();i++){
if(A==a[i]&&B==b[i])return true;
}
return false;
}
string s;
int main(){
cin>>s;
for(int i=0;i<s.size();i++){
if(!check(s[i],s[s.size()-i-1]))return puts("NIE");
}
return puts("TAK");
}

Educational Codeforces Round 14 B. s-palindrome 水题的更多相关文章

  1. Educational Codeforces Round 7 B. The Time 水题

    B. The Time 题目连接: http://www.codeforces.com/contest/622/problem/B Description You are given the curr ...

  2. Educational Codeforces Round 7 A. Infinite Sequence 水题

    A. Infinite Sequence 题目连接: http://www.codeforces.com/contest/622/problem/A Description Consider the ...

  3. Educational Codeforces Round 11 A. Co-prime Array 水题

    A. Co-prime Array 题目连接: http://www.codeforces.com/contest/660/problem/A Description You are given an ...

  4. Educational Codeforces Round 10 C. Foe Pairs 水题

    C. Foe Pairs 题目连接: http://www.codeforces.com/contest/652/problem/C Description You are given a permu ...

  5. Educational Codeforces Round 14 A. Fashion in Berland 水题

    A. Fashion in Berland 题目连接: http://www.codeforces.com/contest/691/problem/A Description According to ...

  6. Educational Codeforces Round 24 CF 818 A-G 补题

    6月快要结束了 期末也过去大半了 马上就是大三狗了 取消了小学期后20周的学期真心长, 看着各种北方的学校都放假嗨皮了,我们这个在北回归线的学校,还在忍受酷暑. 过年的时候下定决心要拿块ACM的牌子, ...

  7. Educational Codeforces Round 5(A,B题)

    虽然是水题但还是贴下代码把 A #include<cstring> #include<cstdio> using namespace std; ; char x[qq],y[q ...

  8. Educational Codeforces Round 2 C. Make Palindrome 贪心

    C. Make Palindrome Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/600/pr ...

  9. Educational Codeforces Round 2 C. Make Palindrome —— 贪心 + 回文串

    题目链接:http://codeforces.com/contest/600/problem/C C. Make Palindrome time limit per test 2 seconds me ...

随机推荐

  1. 原始套接字-自定义IP首部和TCP首部

    /* ===================================================================================== * * Filenam ...

  2. Mac下安装zsh(Oh My ZSH)的shell,替代原有的bash

    说明:一开始装zsh我是拒绝的,因为这个东西装简单,卸载很难,并且装了之后默认Shell的配置文件不能用了,比如~/.bashrc这些.所以在装的时候要再三考虑好! 官网:http://ohmyz.s ...

  3. PHP 文件加密Zend Guard Loader 学习和使用(如何安装ioncube扩展对PHP代码加密)

    一.大体流程图 二.PHP 项目文件加密 下表列出了Zend产品中的PHP版本及其内部API版本和Zend产品版本. 如何加密请往后看 三.如何使用 第一步:确认当前环境 Amai Phalcon 前 ...

  4. Linux 基础知识(一) shell的&&和|| 简单使用

    shell 在执行某个命令的时候,会返回一个返回值,该返回值保存在 shell 变量 $? 中.当 $? == 0 时,表示执行成功:当 $? == 1 时,表示执行失败.  有时候,下一条命令依赖前 ...

  5. Spring RedisTemplate操作-通道操作(10)

    @Autowired @Resource(name = "redisTemplate") private RedisTemplate<String, String> r ...

  6. 那些年的 网络通信之 UDP 数据报包传输---

    下面是 一个多线程,基于 UDP 用户数据报包 协议 的 控制台聊天小程序 import java.io.*; import java.net.*; class Send implements Run ...

  7. spring Mvc Web 编码相关 [model 到 视图传递数据] (九)

    在某种编码环境,由bean注解的参数可能会发生乱码问题. 即可页面web.xml或其他地方都设备UTF-8, 但还是会有这样的问题. 首先不要使用model传到视图的数据. 第二,不要request. ...

  8. 对package.json的理解和学习

    一.初步理解 1. npm安装package.json时  直接转到当前项目目录下用命令npm install 或npm install --save-dev安装即可,自动将package.json中 ...

  9. 使用 jquery-autocomplete插件 完成文本框输入自动填充联想效果 解决兼容IE输入中文问题

    项目中有时会用到ajax自动补全查询,就像Google的搜索框中那样,输入汉字或者字母的首个字母,则包含这个汉字或者字母的相关条目会显示出来供用户选择,该插件就是实现这样的功能的.autocomple ...

  10. Socket心跳包机制总结【转】

    转自:https://blog.csdn.net/qq_23167527/article/details/54290726 跳包之所以叫心跳包是因为:它像心跳一样每隔固定时间发一次,以此来告诉服务器, ...