codeforces 691B B. s-palindrome(水题)
题目链接:
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(水题)的更多相关文章
- codeforces 577B B. Modulo Sum(水题)
题目链接: B. Modulo Sum time limit per test 2 seconds memory limit per test 256 megabytes input standard ...
- Codeforces Round #367 (Div. 2)---水题 | dp | 01字典树
A.Beru-taxi 水题:有一个人站在(sx,sy)的位置,有n辆出租车,正向这个人匀速赶来,每个出租车的位置是(xi, yi) 速度是 Vi;求人最少需要等的时间: 单间循环即可: #inclu ...
- codeforces 696A Lorenzo Von Matterhorn 水题
这题一眼看就是水题,map随便计 然后我之所以发这个题解,是因为我用了log2()这个函数判断在哪一层 我只能说我真是太傻逼了,这个函数以前听人说有精度问题,还慢,为了图快用的,没想到被坑惨了,以后尽 ...
- CodeForces 589I Lottery (暴力,水题)
题意:给定 n 和 k,然后是 n 个数,表示1-k的一个值,问你修改最少的数,使得所有的1-k的数目都等于n/k. 析:水题,只要用每个数减去n/k,然后取模,加起来除以2,就ok了. 代码如下: ...
- Codeforces Gym 100286G Giant Screen 水题
Problem G.Giant ScreenTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/con ...
- codeforces 710A A. King Moves(水题)
题目链接: A. King Moves 题意: 给出king的位置,问有几个可移动的位置; 思路: 水题,没有思路; AC代码: #include <iostream> #include ...
- codeforces 659A A. Round House(水题)
题目链接: A. Round House time limit per test 1 second memory limit per test 256 megabytes input standard ...
- CodeForces 489B BerSU Ball (水题 双指针)
B. BerSU Ball time limit per test 1 second memory limit per test 256 megabytes input standard input ...
- codeforces 702A A. Maximum Increase(水题)
题目链接: A. Maximum Increase time limit per test 1 second memory limit per test 256 megabytes input sta ...
- Codeforces gym 100685 C. Cinderella 水题
C. CinderellaTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100685/problem/C ...
随机推荐
- 更改navigationBar 颜色
if (IS_IOS7()) { /* iOS7 时 Navigation 颜色 */ [[UINavigationBar appearance] setBarTintColor: HexCo ...
- IntelliJ IDEA插件-常用插件
IntelliJ IDEA的插件真的很多,最近的新版集成的插件已经基本够用,下面是收集的一些常用插件,根据需要来安装和测试.如果还是没有找到,那么自己来开发一个. 官网:https://plugins ...
- android应用开发之View的大小计量单位(px、dpi、dp、dip、sp)
http://blog.csdn.net/ljianhui/article/details/43601495?ref=myread 一.像素(px)与屏幕分辨率 1)px(Pixels ,像素):对应 ...
- js创建post请求
/**js提交post请求:隐藏请求参数**/function postDetail(URL, PARAMTERS) { //创建form表单 var temp_form = document.cre ...
- android 获得电池状态
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools= ...
- kafka的安装和使用;kafka常用操作命令
kafka:基于发布/订阅的分布式消息系统.数据管道:最初用来记录活动数据--包括页面访问量(Page View).被查看内容方面的信息以及搜索情况等内容和运营数据--服务器的性能数据(CPU.IO使 ...
- BUPT复试专题—网络传输(2014网研)
题目描述 网络的高效互联与智能传输是提升海量用户服务请求映射效率的重要措施.在这个任务中,你需耍在最小的传输时间内,将数据源传输到指定的网络节点中.我们给定的网络一共包含N个节点,其中节点1为数据源. ...
- [HTML5] Show Images of Differing Resolutions Depending on the Viewport Width with srcset
For small viewports, we want to save bandwidth and we may be dealing with slow speeds; so it's very ...
- HDU 4422 The Little Girl who Picks Mushrooms(数学)
题目链接:http://acm.hdu.edu.cn/showproblem.php? pid=4422 Problem Description It's yet another festival s ...
- iPhone 适配之路
(1)1x时代 2007年,初代iPhone公布,屏幕的宽高是320*480像素.这个分辨率一直到iPhone3GS也保持不变. 那时编写iOS的App应用程序.仅仅支持绝对定位. 比方一个butto ...