Educational Codeforces Round 14 B. s-palindrome 水题
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 水题的更多相关文章
- Educational Codeforces Round 7 B. The Time 水题
B. The Time 题目连接: http://www.codeforces.com/contest/622/problem/B Description You are given the curr ...
- Educational Codeforces Round 7 A. Infinite Sequence 水题
A. Infinite Sequence 题目连接: http://www.codeforces.com/contest/622/problem/A Description Consider the ...
- 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 ...
- Educational Codeforces Round 10 C. Foe Pairs 水题
C. Foe Pairs 题目连接: http://www.codeforces.com/contest/652/problem/C Description You are given a permu ...
- Educational Codeforces Round 14 A. Fashion in Berland 水题
A. Fashion in Berland 题目连接: http://www.codeforces.com/contest/691/problem/A Description According to ...
- Educational Codeforces Round 24 CF 818 A-G 补题
6月快要结束了 期末也过去大半了 马上就是大三狗了 取消了小学期后20周的学期真心长, 看着各种北方的学校都放假嗨皮了,我们这个在北回归线的学校,还在忍受酷暑. 过年的时候下定决心要拿块ACM的牌子, ...
- Educational Codeforces Round 5(A,B题)
虽然是水题但还是贴下代码把 A #include<cstring> #include<cstdio> using namespace std; ; char x[qq],y[q ...
- Educational Codeforces Round 2 C. Make Palindrome 贪心
C. Make Palindrome Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/600/pr ...
- Educational Codeforces Round 2 C. Make Palindrome —— 贪心 + 回文串
题目链接:http://codeforces.com/contest/600/problem/C C. Make Palindrome time limit per test 2 seconds me ...
随机推荐
- Linux(Debian)软件安装
# 配置/etc/apt/sources.list 通过root权限修改/etc/apt/sources.list $ su #输入密码进入root权限 $ chmod 0666 /etc/apt/s ...
- AngularJS入门基础——表单验证
<form name="form" novalidata> <label name="email">your email</l ...
- 工具类。父类(Pom文件)
ego_parent(pom文件) <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="ht ...
- MySQL用户密码过期登陆报错ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
今天接到主从复制失败告警,查看MySQL,发现MySQL能够登陆但是执行命令报错, ERROR 1820 (HY000): You must reset your password using ALT ...
- 小白学习安全测试(四)——扫描工具-Vega
WEB扫描工具-Vega 纯图形化界面,Java编写的开源web扫描器.两种工作模式:扫描模式和代理模式[主流扫描功能].用于爬站.处理表单,注入测试等.支持SSL:http://vega/ca.cr ...
- java虚拟机规范(se8)——java虚拟机结构(一)
本文翻译自:https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-2.html 第二章 虚拟机结构 本文档描述了一个抽象的虚拟机规范,并不描述 ...
- python基础--模块使用
一:模块介绍 模块分为三种: 自定义模块 内置标准模块(又称标准库) 开源模块 自定义模块使用 # -*- coding:utf-8 -*- __author__ = 'shisanjun' &q ...
- iOS仿安卓手势解锁
界面是一个九宫格的布局.九宫格实现思路. 先确定有多少列 cloum = 3; 计算出每列之间的距离 计算为: CGFloat margin = (当前View的宽度 - 列数 * 按钮的宽度) / ...
- .NetCore中使用AspectCore、ExceptionLess 实现AOP操作日志记录
结合前面封装的ExceptionLess,接下来使用 AspectCore 实现AOP日志处理 nuget导入AspectCore.Core .AspectCore.Extensions.Depend ...
- 关于spark ui中executor显示的内存量与设置的内存量不符的问题
executor显示的内存量是实际执行程序使用的内存量,也就是排除bspark.storage.memoryFraction设置的比例外,然后使用的内存量. 默认是0.6,所以executory和dr ...