748 C. Santa Claus and Robot codeforces
来源:互联网 发布:ug五轴联动编程 编辑:程序博客网 时间:2024/06/05 01:04
#include<bits/stdc++.h>using namespace std;int main(){ int n; string str; cin>>n>>str; int n1=0,n2=0,sum=0; for(int i=0;i<str.size();i++) { if(str[i]=='L') { if(n1==2) { sum++; n2=0; } n1=1; } if(str[i]=='R') { if(n1==1) { sum++; n2=0; } n1=2; } if(str[i]=='U') { if(n2==2) { sum++; n1=0; } n2=1; } if(str[i]=='D') { if(n2==1) { sum++; n1=0; } n2=2; } } cout<<sum+1<<endl; return 0;}
0 0
- 748 C. Santa Claus and Robot codeforces
- 【codeforces 752C】Santa Claus and Robot
- 【codeforces 752C】Santa Claus and Robot
- 【Codeforces 748 C Santa Claus and Robot】+ 思维
- 748C Santa Claus and Robot
- 【Codeforces Round #389】Codeforces 752C Santa Claus and Robot
- Codeforces 752C Santa Claus and Robot 思维
- Codeforces Round #389 C. Santa Claus and Robot
- codeforces748c-Santa Claus and Robot
- Codeforces Round #389(Div.2)C Santa Claus and Robot【思维】
- Codeforces Round #389 (Div. 2) C. Santa Claus and Robot 贪心+最短路
- CodeForces 748E. Santa Claus and Tangerines
- Codeforces 748 E Santa Claus and Tangerines
- 【Codeforces 748 B Santa Claus and Keyboard Check】
- Codeforces 748B-Santa Claus and Keyboard Check
- Codeforces 748B Santa Claus and Keyboard Check
- CodeForces 748E. Santa Claus and Tangerines(二分,递推)
- 【CodeForces 748B 】Santa Claus and Keyboard Check
- python 读取配置文件
- spring-security 在jsp中的标签库
- 对象作用域与Servlet事件监听器
- linux文件系统简介
- 存储管理——虚拟内存
- 748 C. Santa Claus and Robot codeforces
- C程序设计 例题5.11 译密码
- 利用Linux信号SIGUSR1调试嵌入式程序
- Linux命令行操作
- ubuntu安装jdk8
- Android之图片压缩和Uri与String类型的路径转换,获取图片,文件大小的工具类
- 关于反射的运行时机
- JavaWeb过滤器
- 群辉tomcat安装目录,群辉修改tomcat设置