Mirrored String I Gym
来源:互联网 发布:sm4算法介绍 编辑:程序博客网 时间:2024/05/17 22:01
https://vjudge.net/contest/159763#problem/H
判断是不是由指定字符组成的回文串
//// main.cpp// 160929//// Created by 刘哲 on 17/4/13.// Copyright © 2016年 my_code. All rights reserved.////#include <bits/stdc++.h>#include <iostream>#include <algorithm>#include <cstdio>#include <cmath>#include <cstring>#include <string>#include <string.h>#include <map>#include <set>#include <queue>#include <deque>#include <list>#include <bitset>#include <stack>#include <stdlib.h>#define lowbit(x) (x&-x)using namespace std;map<char,int>mp;int main(){ int n; cin>>n; //A, H, I, M, O, T, U, V, W, X, Y mp['A']=1; mp['H']=1; mp['I']=1; mp['M']=1; mp['O']=1; mp['T']=1; mp['U']=1; mp['V']=1; mp['W']=1; mp['X']=1; mp['Y']=1; while(n--){ string s; cin>>s; int flag = 1; for(int i=0;i<s.length();i++){ if(mp[s[i]]&&s[i]==s[s.length()-1-i]) { continue; } flag = 0; break; } if(flag) cout<<"yes"<<endl; else cout<<"no"<<endl; } return 0;}
0 0
- Mirrored String I Gym
- Mirrored String II Gym
- Mirrored String II 【最长回文子串】
- CF Gym 101615I Long Long String【模拟】
- CodeForces Gym 100735I
- Gym 101147.I
- Gym 101164.I
- Gym 101243.I
- Gym 101482. I
- Gym 101623I
- [arc075f]Mirrored
- Gym 100499I (数学 模拟)
- Gym 100703I 尺取法
- Gym 100623I Important Wires
- codeforces Gym 101097 I Sticks
- Codeforces Gym 101164I Cubes
- Gym 101484 I Matrix Sum
- Inverted Signs Gym-101522I
- Hadoop知识点参考
- Cocos Creator各个场景之间传递数据的方法
- nodejs网页请求
- java中抽象类与接口
- ubuntu 16.04 Lancher Bottom
- Mirrored String I Gym
- JavaScript中设置默认值时需要注意的逻辑运算
- SpringMVC学习(2):使用@RequestMapping映射请求方式
- hdu2594(KMP算法水题)
- Java编程思想之final关键字的深入解析
- CSDN博客入门系列——如何转载博客
- POJ -1037-A decorative fence(动归 +计数)
- Sklearn学习之路(2)——围绕评估器转换器展开讨论
- ffplay问题Protocol 'rtp' not on whitelist 'file,crypto'!