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 ...
随机推荐
- 使用 ftrace 调试 Linux 内核,第 2 部分
ftrace 操作概述 使用 ftrace 提供的跟踪器来调试或者分析内核时需要如下操作: 切换到目录 /sys/kernel/debug/tracing/ 下 查看 available_tracer ...
- 使用 ftrace 调试 Linux 内核,第1部分
ftrace 是 Linux 内核中提供的一种调试工具.使用 ftrace 可以对内核中发生的事情进行跟踪,这在调试 bug 或者分析内核时非常有用.本系列文章对 ftrace 进行了介绍,分为三部分 ...
- ngxtop
http://www.cnblogs.com/felixzh/p/8709201.html
- 小窥React360——用React创建360全景VR体验
前言 混迹VR届的发烧友兼开发者们一定不要错过这款FaceBook推出的跨端VR开发框架——React360,称为360全景体验框架更为准确,因为其前身是FaceBook和Oculus2017年 ...
- python的__name__和dir()属性
1.__name__属性 一个模块被另一个程序第一次引入时,其主程序将运行.如果我们想在模块被引入时,模块中的某一程序块不执行,我们可以用__name__属性来使该程序块仅在该模块自身运行时执行.示例 ...
- android 环境变量配置,以及sdcard配置
第一步,打开环境变量配置窗口.右击计算机,属性-高级系统设置-环境变量. 第二步,添加android系统环境变量.在系统变量下,选择path,点击编辑,然后在最前面输入android sdk开发工具, ...
- DICOM医学图像显示算法改进与实现——LUT
引言 随着Ul(超声成像).CT(计算机断层成像).MRI(核磁共振成像).CR(计算机X线成像).电子内窥镜.盯(正电子发射断层成像)和MI(分子影像)等医学影像设备不断涌现,利用计算机对医学影像设 ...
- Android 系统广播机制
一.Android应用程序注冊广播接收器(registerReceiver)的过程分析 參考Android应用程序注冊广播接收器(registerReceiver)的过程分析http://blog.c ...
- [ACM] ZOJ 3725 Painting Storages (DP计数+组合)
Painting Storages Time Limit: 2 Seconds Memory Limit: 65536 KB There is a straight highway with ...
- mongodb+php通过_id查询
在php中通过_id 在mongodb中查找特定记录: <?php $conn=new Mongo("127.0.0.1:27017"); #连接指定端口远程主机 $db=$ ...