gym-101350H
题意:给你一个字符串,判断是否为镜像串,镜像串的定义:是一个回文串且只能由对称的字母组成,比如W,M,这些,因为要镜像对称;
解题思路:首先判断一下这个字符串是不是全由对称字母组成,不是就不用继续了,如果全由对称字母组成,判断下是否为回文串;
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
int main()
{
char s1[]="WTYUIOAHXVM";
char s[];
int flag;
int right;
int left;
int t;
int len;
int len1;
int flag2;
cin>>t;
while(t--)
{
cin>>s;flag=;flag2=;
len=strlen(s);
len1=strlen(s1);
for(int i=;i<len;i++)
{
flag=;
for(int j=;j<len1;j++)
{
if(s[i]==s1[j])
{
flag=;break;
}
}
if(flag==)
break;
}
if(flag==)
cout<<"no\n";
else
{
for(int i=;i<=len/-;i++)
{
if(s[i]!=s[len-i-])
{
flag2=;break;
}
}
if(flag2==)
cout<<"no\n";
else
cout<<"yes\n";
}
}
return ;
}
gym-101350H的更多相关文章
- ACM: Gym 101047M Removing coins in Kem Kadrãn - 暴力
Gym 101047M Removing coins in Kem Kadrãn Time Limit:2000MS Memory Limit:65536KB 64bit IO Fo ...
- ACM: Gym 101047K Training with Phuket's larvae - 思维题
Gym 101047K Training with Phuket's larvae Time Limit:2000MS Memory Limit:65536KB 64bit IO F ...
- ACM: Gym 101047E Escape from Ayutthaya - BFS
Gym 101047E Escape from Ayutthaya Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I6 ...
- ACM: Gym 101047B Renzo and the palindromic decoration - 手速题
Gym 101047B Renzo and the palindromic decoration Time Limit:2000MS Memory Limit:65536KB 64 ...
- Gym 101102J---Divisible Numbers(反推技巧题)
题目链接 http://codeforces.com/gym/101102/problem/J Description standard input/output You are given an a ...
- Gym 100917J---Judgement(01背包+bitset)
题目链接 http://codeforces.com/gym/100917/problem/J Description standard input/outputStatements The jury ...
- Gym 100917J---dir -C(RMQ--ST)
题目链接 http://codeforces.com/gym/100917/problem/D problem description Famous Berland coder and IT mana ...
- Gym 101102D---Rectangles(单调栈)
题目链接 http://codeforces.com/gym/101102/problem/D problem description Given an R×C grid with each cel ...
- Gym 101102C---Bored Judge(区间最大值)
题目链接 http://codeforces.com/gym/101102/problem/C problem description Judge Bahosain was bored at ACM ...
- 2016"百度之星" - 初赛(Astar Round2A)Gym Class(拓扑排序)
Gym Class Accepts: 849 Submissions: 4247 Time Limit: 6000/1000 MS (Java/Others) Memory Limit: 65 ...
随机推荐
- 本地搭了http服务(localhost),怎么在vue环境下,通过axios获取到接口数据
1. 找到 vue项目\config\index.js 文件 2. proxyTable: { '/api': { target: 'http://127.0.0.1:9420', changeOri ...
- "INSTALL_FAILED_DUPLICATE_PERMISSION "错误解决
我们在进行Android组件安全测试时,如果遇到声明了权限的组件,在编写PoC时,可能会遇到如下错误提示: INSTALL_FAILED_DUPLICATE_PERMISSION perm=com.m ...
- 网络爬虫之Url含有中文如何转码
一:背景 今天在使用Jsoup对一个网站进行数据爬取,发现爬取内容为该搜索结果是0条,请求头啥的都填好,利用Chrome开发者工具发现请求Url路径不含中文,抱着试一试的态度,我复制此段非中文参数进行 ...
- ASP.NET MVC5+EF6+EasyUI 后台管理系统(92)-打印EasyUI 的datagrid表格
前言 应用系统有时候需要打印Datagrid的表格内容,我们本节就来学习打印datagrid内容 打印主要使用:web打印(我们之前有讲过web打印插件jqprint) + 将datagrid重新编制 ...
- 使用 OpenSSL 创建私有 CA:1 根证书
OpenSSL 创建私有 CA 三部曲:使用 OpenSSL 创建私有 CA:1 根证书使用 OpenSSL 创建私有 CA:2 中间证书使用 OpenSSL 创建私有 CA:3 用户证书 OpenS ...
- 几何学观止(Lie群部分)
上承这个页面,这次把Lie群的部分写完了 几何学观止-微分几何部分(20181102).pdf 我觉得其他部分(尤其是代数几何部分)我目前没有把握写得令自己满意,总之希望在毕业前能写完吧. 这次调整了 ...
- 小L记单词
题目描述 小L最近在努力学习英语,但是对一些词组总是记不住,小L小把这些词组中每一个单词的首字母都记一下,这样形成词组的缩写,通过这种方式小L的学习效率明显提高. 输入 输入有多行,每组测试数据占一行 ...
- Randomized Online PCA Algorithms with Regret Bounds that are Logarithmic in the Dimension
目录 Setup of Batch PCA and Online PCA Hedge Algorithm 改进算法 用于矩阵 \(rounding()\) 前俩次,都用到了\(rounding()\) ...
- Python容器
列表 list 1.列表的格式为,把值放入[ ]中 >>> lis = ['a', 1, ['a', 'c', 1]] 2.列表中可以嵌套任何类型 索引 因为列表是有序的,那么我们可 ...
- semantic-ui 输入框
1.标准输入框 semantic-ui中定义输入框需要将input标签包含于另外一个标签内,外层标签的class为ui input,注意外层标签可以是div,span.p.i. <div cla ...