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 ...
随机推荐
- flask-script插件
首先在启动Flask项目时,我们可以传不同的参数作为运行参数.但是我们只能在入口app.run()传参.这样十分的不方便.Flask-Script 是一个 Flask 扩展,为 Flask 程序添加了 ...
- jqeury设置元素屏幕居中
jQuery.fn.center = function () { this.css(“position”,”absolute”); this.css(“top”, ( $(window).height ...
- OSI模型详解
OSI 七层模型通过七个层次化的结构模型使不同的系统不同的网络之间实现可靠的通讯,因此其最主要的功能就是帮助不同类型的主机实现数据传输 . 完成中继功能的节点通常称为中继系统.在OSI七层模型中,处于 ...
- TFS2018 获取所有Build变量及变量值
添加一个Command Line 步骤,Tool设置为 cmd ,并设置参数为 /k set 注意:若在执行时出现如下报错信息,Tool的值改成 cmd.exe --20T02::.0416435Z ...
- Android应用开发 WebView与服务器端的Js交互
最近公司再添加功能的时候,有一部分功能是用的html,在一个浏览器或webview中展示出html即可.当然在这里我们当然用webview控件喽 WebApp的好处: 在应用里嵌套web的好处有这么几 ...
- yum gd linux
32位操作系统安装命令:[root@localhost ~]# yum install php-gd*64位操作系统安装命令:[root@localhost ~]# yum install php-g ...
- Nuxt.js使用mint-ui
环境 vue nuxt 要使用mint-ui 记录下其中的坑 npm install mint-ui --save plugins目录下 增加 mint-ui.js 代码: import Vue fr ...
- BUPT复试专题—List(2015)
题目描述 在该LIST上实现3种操作 1.append x在该LIST末尾添加x,x是32位整数 2.pop删除该LIST末尾的数 3.find i寻找第i个数,若i为负数表示寻找倒数第i个数,例如i ...
- docker save docker load
docker save && docker load docker save 镜像1 镜像2 | gzip > images.tar.gz 打包镜像为压缩文件 docker sa ...
- java栈、堆
一.栈.堆 几个小概念 1.寄存器:最快的存储区, 由编译器根据需求进行分配,我们在程序中无法控制. 2. 栈:存放基本类型的变量数据和对象的引用,但对象本身不存放在栈中,而是存放在堆(new 出来的 ...