Coder-Strike 2014 - Finals (online edition, Div. 2) B. Start Up
需要满足的条件是
(1)每个字母是对称的
(2)每个字符串是对称的
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
const string mirrorChar = "AHIMOTUVWXY";
int main(){
string str;
cin >> str;
bool flag = true;
for(int i = ; i < str.length(); ++ i){
if(mirrorChar.find(str[i])==string::npos) {
flag = false;break;
}
}
if(flag && str == string(str.rbegin(),str.rend())) cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
Coder-Strike 2014 - Finals (online edition, Div. 2) B. Start Up的更多相关文章
- Coder-Strike 2014 - Finals (online edition, Div. 2) A. Pasha and Hamsters
水题 #include <iostream> #include <vector> #include <algorithm> using namespace std; ...
- Coder-Strike 2014 - Finals (online edition, Div. 2) C题
C. Online Meeting time limit per test 1 second memory limit per test 256 megabytes input standard in ...
- Coder-Strike 2014 - Finals (online edition, Div. 1)
CF 420A A. Start Up 题目链接: http://codeforces.com/problemset/problem/420/A 题目意思: 给一个字符串A,通过镜面反射后得到A', ...
- Bubble Cup 11 - Finals [Online Mirror, Div. 1]题解 【待补】
Bubble Cup 11 - Finals [Online Mirror, Div. 1] 一场很好玩的题啊! I. Palindrome Pairs 枚举哪种字符出现奇数次. G. AI robo ...
- IndiaHacks 2016 - Online Edition (Div. 1 + Div. 2) B. Bear and Compressing
B. Bear and Compressing 题目链接 Problem - B - Codeforces Limak is a little polar bear. Polar bears h ...
- IndiaHacks 2016 - Online Edition (Div. 1 + Div. 2) E - Bear and Forgotten Tree 2 链表
E - Bear and Forgotten Tree 2 思路:先不考虑1这个点,求有多少个连通块,每个连通块里有多少个点能和1连,这样就能确定1的度数的上下界. 求连通块用链表维护. #inclu ...
- IndiaHacks 2016 - Online Edition (Div. 1 + Div. 2) E. Bear and Forgotten Tree 2 bfs set 反图的生成树
E. Bear and Forgotten Tree 2 题目连接: http://www.codeforces.com/contest/653/problem/E Description A tre ...
- IndiaHacks 2016 - Online Edition (Div. 1 + Div. 2) D. Delivery Bears 二分+网络流
D. Delivery Bears 题目连接: http://www.codeforces.com/contest/653/problem/D Description Niwel is a littl ...
- IndiaHacks 2016 - Online Edition (Div. 1 + Div. 2) C. Bear and Up-Down 暴力
C. Bear and Up-Down 题目连接: http://www.codeforces.com/contest/653/problem/C Description The life goes ...
随机推荐
- AlwaysOn的认识与相关理解
AlwaysOn技术的简要说明: SQL Server2012所支持的AlwaysOn技术集中了故障转移群集.数据库镜像和日志传送三者的优点,但又不相同.故障转移群集的单位是SQL实例,数据库镜像和日 ...
- WPF框架MVVM简单例子
MVVM是Model-View-ViewModel的缩写形式,它通常被用于WPF或Silverlight开发.Model——可以理解为带有字段,属性的类.View——可以理解为我们所看到的UI.Vie ...
- ASP.NET MVC 伪静态的实现
public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { routes.Ignore ...
- [LeetCode] Length of Last Word
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the l ...
- 攻城狮在路上(叁)Linux(二十二)--- linux磁盘挂载与卸载 mount umount
挂载就是将文件系统与目录结合的操作.挂载点就是目录,该目录就是进入分区或文件系统的入口. 一.挂载前的注意事项: 1.单一文件系统不应该被重复挂载在不同的挂载点中. 2.单一目录不应该重复挂载多个文件 ...
- PAT A 1004. Counting Leaves (30)【vector+dfs】
题目链接:https://www.patest.cn/contests/pat-a-practise/1004 大意:输出按层次输出每层无孩子结点的个数 思路:vector存储结点,dfs遍历 #in ...
- JDK中的设计模式
Creational(创建模式) Abstract factory: 创建一组有关联的对象实例.这个模式在JDK中也是相当的常见,还有很多的framework例如Spring.我们很容易找到这样的实例 ...
- IIS配置php运行环境默认加载的php.ini路径
第一步: 把PHP的安装路径添加到环境变量Path中,右键 “我的电脑” -> 高级 -> 环境变量 -> 系统变量,追加 D:PHP-5.2.8\; 第二步: 新建“系统变量” P ...
- 求余VS求模--C语言中表述
之前看帖子,发现许多时候基本上大家都把求模和求余混为一谈了.但实际上二者的概念是有区别的 1. 求余 在C语言中,求余对应的操作符是%,且a%b求余的最后结果总是与a符号相同,最后的数值为|a|% ...
- 数值的三种表示--C语言
在C语言中,数值常数可以是3中形式: (1)在数值前面加0表示的是8进制数据: (2)在数字前面加0x表示的是16进制数: (3)在数值前面什么也不加,表示的是10进制数值. 目前C语言 ...