题目链接:

B. s-palindrome

题意:

问给定的字符串是否是镜面对称;

思路:

直接看哪些字母是镜面对称的就行;

AC代码:

//#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath> using namespace std; #define For(i,j,n) for(int i=j;i<=n;i++)
#define mst(ss,b) memset(ss,b,sizeof(ss)); typedef long long LL; template<class T> void read(T&num) {
char CH; bool F=false;
for(CH=getchar();CH<''||CH>'';F= CH=='-',CH=getchar());
for(num=;CH>=''&&CH<='';num=num*+CH-'',CH=getchar());
F && (num=-num);
}
int stk[], tp;
template<class T> inline void print(T p) {
if(!p) { puts(""); return; }
while(p) stk[++ tp] = p%, p/=;
while(tp) putchar(stk[tp--] + '');
putchar('\n');
} //const LL mod=1e9+7;
const double PI=acos(-1.0);
const LL inf=1e18;
const int N=2e5+;
const int maxn=;
const double eps=1e-; char s[],str[]; int check(char x ,char y)
{
if(x=='A'&&y=='A')return ;
if(x=='I'&&y=='I')return ;
if(x=='M'&&y=='M')return ;
if(x=='O'&&y=='O')return ;
if(x=='T'&&y=='T')return ;
if(x=='H'&&y=='H')return ;
if(x=='U'&&y=='U')return ;
if(x=='W'&&y=='W')return ;
if(x=='X'&&y=='X')return ;
if(x=='Y'&&y=='Y')return ;
if(x=='V'&&y=='V')return ;
if(x=='x'&&y=='x')return ;
if(x=='w'&&y=='w')return ;
if(x=='o'&&y=='o')return ;
if(x=='v'&&y=='v')return ;
//if(x=='m'&&y=='m')return 1;
//if(x=='n'&&y=='n')return 1;
// if(x=='i'&&y=='i')return 1;
if(x=='p'&&y=='q')return ;
if(x=='q'&&y=='p')return ;
if(x=='b'&&y=='d')return ;
if(x=='d'&&y=='b')return ;
return ;
}
int main()
{
scanf("%s",s);
int len=strlen(s);
For(i,,len-)
{
str[len-i-]=s[i];
}
For(i,,len-)
{
if(!check(s[i],str[i]))
{
// cout<<s[i]<<" "<<str[i]<<endl;
cout<<"NIE";
return ;
}
}
cout<<"TAK";
return ;
}

codeforces 691B B. s-palindrome(水题)的更多相关文章

  1. codeforces 577B B. Modulo Sum(水题)

    题目链接: B. Modulo Sum time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  2. Codeforces Round #367 (Div. 2)---水题 | dp | 01字典树

    A.Beru-taxi 水题:有一个人站在(sx,sy)的位置,有n辆出租车,正向这个人匀速赶来,每个出租车的位置是(xi, yi) 速度是 Vi;求人最少需要等的时间: 单间循环即可: #inclu ...

  3. codeforces 696A Lorenzo Von Matterhorn 水题

    这题一眼看就是水题,map随便计 然后我之所以发这个题解,是因为我用了log2()这个函数判断在哪一层 我只能说我真是太傻逼了,这个函数以前听人说有精度问题,还慢,为了图快用的,没想到被坑惨了,以后尽 ...

  4. CodeForces 589I Lottery (暴力,水题)

    题意:给定 n 和 k,然后是 n 个数,表示1-k的一个值,问你修改最少的数,使得所有的1-k的数目都等于n/k. 析:水题,只要用每个数减去n/k,然后取模,加起来除以2,就ok了. 代码如下: ...

  5. Codeforces Gym 100286G Giant Screen 水题

    Problem G.Giant ScreenTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/con ...

  6. codeforces 710A A. King Moves(水题)

    题目链接: A. King Moves 题意: 给出king的位置,问有几个可移动的位置; 思路: 水题,没有思路; AC代码: #include <iostream> #include ...

  7. codeforces 659A A. Round House(水题)

    题目链接: A. Round House time limit per test 1 second memory limit per test 256 megabytes input standard ...

  8. CodeForces 489B BerSU Ball (水题 双指针)

    B. BerSU Ball time limit per test 1 second memory limit per test 256 megabytes input standard input ...

  9. codeforces 702A A. Maximum Increase(水题)

    题目链接: A. Maximum Increase time limit per test 1 second memory limit per test 256 megabytes input sta ...

  10. Codeforces gym 100685 C. Cinderella 水题

    C. CinderellaTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100685/problem/C ...

随机推荐

  1. CentOS 7.5 安装Docker 教程

    Docker简介 Docker是一个开源的容器引擎,它有助于更快地交付应用.Docker可将应用程序和基础设施层隔离,并且能将基础设施当作程序一样进行管理. 使用Docker可更快地打包.测试以及部署 ...

  2. python多线程实践小结

    参考:http://www.cnblogs.com/tqsummer/archive/2011/01/25/1944771.html #!/usr/bin/env python import sys ...

  3. Flux --> Redux --> Redux React 入门 基础实例使用

    本文的目的很简单,介绍Redux相关概念用法 及其在React项目中的基本使用 假设你会一些ES6.会一些React.有看过Redux相关的文章,这篇入门小文应该能帮助你理一下相关的知识 一般来说,推 ...

  4. 【String】String.format(format,args...)的使用解析

    String.format(format,args...)的使用解析 使用kotlin 中使用示例 ================================================== ...

  5. Shannon-Fano-Elias编码的C语言实现

    Shannon-Fano-Elias编码 一.理论分析 Shannon-Fano-Elias编码是利用累积分布函数来分配码字. 不失一般性,假定取X={1,2,-m}.如果对于全部的x,有p(x)&g ...

  6. Service具体解释(一):什么是Service

    < Service具体解释(一):什么是Service> < Service具体解释(二):Service生命周期> <Service具体解释(三):Service的使用 ...

  7. HDU 1501

    Zipper Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Sub ...

  8. Android入门常见问题

    前言: 眼下非常多人入门用android studio,可是我觉得这是 一个不好的開始. 一个集成的软件,不用你去部署.那么你就好难去学习究竟层的东西. 以后的问题时.问题所在还是在底层,就像&quo ...

  9. 怎样改动X-code中的字体大小、颜色

  10. js 类继承extends

    先看例子: <!DOCTYPE html><html> <head> <meta charset="UTF-8"> <titl ...