Codeforces 691B s-palindrome
水题。
#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<iostream>
using namespace std;
typedef long long LL;
const double pi = acos(-1.0), eps = 1e-;
void File()
{
freopen("D:\\in.txt", "r", stdin);
freopen("D:\\out.txt", "w", stdout);
}
inline int read()
{
char c = getchar(); while (!isdigit(c)) c = getchar();
int x = ;
while (isdigit(c)) { x = x * + c - ''; c = getchar(); }
return x;
} char s[];
int f[][]; void init()
{
f['A']['A']=; f['b']['d']=; f['d']['b']=; f['H']['H']=;
f['I']['I']=; f['M']['M']=; f['O']['O']=; f['o']['o']=;
f['p']['q']=; f['q']['p']=; f['T']['T']=; f['U']['U']=;
f['V']['V']=; f['v']['v']=; f['W']['W']=; f['w']['w']=;
f['X']['X']=; f['x']['x']=; f['Y']['Y']=;
} int main()
{
memset(f,,sizeof f); init();
scanf("%s",s); bool fail=;
int len=strlen(s);
for(int i=;i<=len/;i++) if(f[s[i]][s[len-i-]]==) fail=;
if(fail) printf("NIE\n"); else printf("TAK\n");
return ;
}
Codeforces 691B s-palindrome的更多相关文章
- 【模拟】Codeforces 691B s-palindrome
题目链接: http://codeforces.com/problemset/problem/691/B 题目大意: 求一个字符串是不是镜像的(不是回文).是输出TAK否则RE. 题目思路: [模拟] ...
- CodeForces - 600C Make Palindrome 贪心
A string is called palindrome if it reads the same from left to right and from right to left. For ex ...
- Codeforces Round 486C - Palindrome Transformation 贪心
C. Palindrome Transformation time limit per test 1 second memory limit per test 256 megabytes input ...
- Codeforces Gym100952 C. Palindrome Again !!-回文字符串 (2015 HIAST Collegiate Programming Contest)
C. Palindrome Again !! time limit per test 1 second memory limit per test 64 megabytes input sta ...
- codeforces 600C Make Palindrome
要保证变化次数最少就是出现次数为奇数的相互转化,而且对应字母只改变一次.保证字典序小就是字典序大的字母变成字典序小的字母. 长度n为偶数时候,次数为奇数的有偶数个,按照上面说的搞就好了. n为奇数时, ...
- codeforces 691B B. s-palindrome(水题)
题目链接: B. s-palindrome 题意: 问给定的字符串是否是镜面对称; 思路: 直接看哪些字母是镜面对称的就行: AC代码: //#include <bits/stdc++.h> ...
- 【Codeforces 486C】Palindrome Transformation
[链接] 我是链接,点我呀:) [题意] 光标一开始在p的位置 你可以用上下左右四个键位移动光标(左右)或者更改光标所在的字符(上下增加或减少ascill码) 问你最少要操作多少次才能使得字符串变成回 ...
- Codeforces 1304B. Longest Palindrome
根据数据范围,暴力可以解决,对每一个串,找与其互为回文的串,或者判断自身是否为回文串,然后两两将互为回文的串排列在头尾,中间放且只能最多放一个自身为回文串的串,因为题目说每个串都是不同的 #inclu ...
- Codeforces Round #389 Div.2 D. Santa Claus and a Palindrome
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...
随机推荐
- 如何将编译出来的images拷贝到windows下面刷机
由于SPRD的刷机工具ResearchDownload运行在window环境下:这样,我们平时在开发环境下编译出来的镜像文件就不能直接用于刷机了. 这里涉及到一个双系统中文件共享的方法.由于企业信息安 ...
- 菲菲更名宝贝 得意非凡版 v1.9 免费绿色版
软件名称: 菲菲更名宝贝 得意非凡版软件语言: 简体中文授权方式: 免费软件运行环境: Win8 / Win7 / Vista / WinXP软件大小: 12.5MB图片预览: 软件简介:菲菲更名宝贝 ...
- javascript动画效果之透明度(修改版)
在编写多块同时触发运动的时候,发现一个BUG, timer = setInterval(show, 30);本来show是一个自定义函数,当设为timer = setInterval(show(one ...
- 行列转换之静态、动态、PIVOT方法
/* 标题:普通行列转换(version 2.0) 作者:爱新觉罗.毓华 时间:2008-03-09 地点:广东深圳 说明:普通行列转换(version 1.0)仅针对sql server 2000 ...
- go语法
背景 go语言算是比较常用的开发语言了,但是我发现自己在写代码的时候仍无法做到熟练掌握语法的程度,这个博客是我在因为语法不熟练而必须停下来的地方,整理下来方便查阅和记忆. 数组 ]int //arra ...
- iOS中的项目新特性页面的处理
一般项目中都会出现新特性页面,比如第一次使用应用的时候,或者在应用设置里查看新特性的时候会出现. 这里,选择新建一个专门处理项目新特性的控制器,来完成功能. 首先是 NewFeaturesViewCo ...
- 封装一个DivTag
封装一个DivTag,在页面加载的时候自动执行.用于创建任意的DOM节点,并且可以追加到任意的DOM节点上,可以设置样式,添加文本.var element = { __init__: function ...
- wordpress建站过程1
使用wordpress我们需要理解一些概念: 1.WordPress是一种使用PHP语言开发的博客平台,它的程序是由php构成的,所以想要使用word press必须会php. 2.Wordpress ...
- 【bug】Unable to execute dex: Multiple dex files define
This is a build path issue. Make sure your bin folder is not included in your build path. Right clic ...
- 《Windows驱动开发技术详解》之HelloDDK
编写如下代码: