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 ...
随机推荐
- PHP的Trait机制
PHP的Trait机制 Trait介绍: 1.自PHP5.4起,PHP实现了一种代码复用的方法,称为trait.2.Trait是为类似PHP的单继承语言二准备的一种代码复用机制.3.Trait为了减少 ...
- 让Mac OS X专用高速移动硬盘在Linux下也能被读写
MacBook Pro以及iMac等设备都具备雷电接口和USB 3.0接口,配合使用Mac OS X格式化的专用高速移动硬盘读写数据都非常快.那么这种硬盘可以在Linux下被读写吗?其实,Mac OS ...
- TCP No-Delay
Nagle 算法 由于TCP中包头的大小是固定的,所以在数据(Payload)大小很小的时候IP报文的有效传输率是很低的,Nagle算法就是将多个即将发送的小段的用户数据,缓存并合并成一个大段数据时, ...
- Google的JSON风格指南
官网:https://google.github.io/styleguide/jsoncstyleguide.xml 中文版:https://github.com/darcyliu/google-st ...
- Linux配置防火墙添加端口(Ubuntu/Debian无法使用此方法)
注意:Ubuntu/Debian无法使用此方法 1.打开iptables vi /etc/sysconfig/iptables 2.添加防火墙规则 规则参考:http://www.cnblogs.co ...
- C#使用PrintDocument打印 多页 打印预览
PrintDocument实例所有的订阅事件如下: 创建一个PrintDocument的实例.如下: System.Drawing.Printing.PrintDocument docToPrint ...
- ps --sort排序功能
ps aux --sort +rss/rss根据内存正序排 ps aux --sort -rss 逆序 ps aux --sort -pid/pid ps aux --sort %cpu/-%cpu ...
- Machine Learning—Online Learning
印象笔记同步分享:Machine Learning-Online Learning
- Yii自动生成项目
我喜欢尝试新鲜的东西.以前一直用gii生成工具,前几天突然发现用shell的方法,感觉很不错.特此总结一下yii的几个命令. gii的工具页面: - Controller Generator ...
- HDU 1398 Square Coins(母函数或dp)
Square Coins Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Tota ...