Codeforces_712_B
http://codeforces.com/problemset/problem/712/B
水,判断奇偶即可。
#include<iostream>
#include<string>
using namespace std; int main()
{
string s;
int a = ,b = ;
cin >> s;
for(int i = ;i < s.size();i++)
{
if(s[i] == 'L') a++;
else if(s[i] == 'R') a--;
else if(s[i] == 'U') b++;
else if(s[i] == 'D') b--;
}
a = a>?a:-a;
b = b>?b:-b;
if((a+b)%) cout << - << endl;
else cout << (a+b)/ << endl;
return ;
}
Codeforces_712_B的更多相关文章
随机推荐
- ScheduledThreadPoolExecutor中定时周期任务的实现源码分析
ScheduledThreadPoolExecutor是一个定时任务线程池,相比于ThreadPoolExecutor最大的不同在于其阻塞队列的实现 首先看一下其构造方法: public Schedu ...
- eclipse maven工程错误总汇
1.问题: Target runtime Apache Tomcat v7.0 is not defined 解决方法: right click on your project & ...
- C# 调用R语言
在.net项目中需要调用Matlab生成的DLL,但是在调用过程中报错,截图如下: 在网上搜索一下资料,看到该博客:https://cn.mathworks.com/matlabcentral/new ...
- luogu 题解 P2380 【狗哥采矿】
拿到dp题我们就要想如何推方程 “最北边有bloggium的收集站,最西边有 yeyenum 的收集站.现在要你在这些格子上面安装向北或者向西的传送带(每个格子只能装一种).” 这说明了什么,对于某一 ...
- No property andp found for type String! Traversed path: CmsPage.siteId.
Respository没有找到该参数 1)由该参数,函数名写错,不符合JPA规范 2)实体类没有该参数
- 关于neo4j初入门(2)
DELETE删除 删除节点及相关节点和关系. DELETE <node-name-list> DELETE <node1-name>,<node2-name>,&l ...
- UidGenerator springboot2集成篇
uid-generator 官网集成文档: https://github.com/baidu/uid-generator/blob/master/README.zh_cn.md 由于并没有提供spri ...
- vwmare 十月第 1 弹
step one 不管 是 ubuntu 还是 win vm tools 都是需要在虚拟的系统里面的去安装的. 这一点是相同的.
- 使用Razor表达式 举数组和集合 精通ASP-NET-MVC-5-弗瑞曼
- centos7搭建hadoop2.10高可用(HA)
本篇介绍在centos7中搭建hadoop2.10高可用集群,首先准备6台机器:2台nn(namenode);4台dn(datanode):3台jns(journalnodes) IP hostnam ...