UVA
来源:互联网 发布:centos keepalived nfs 编辑:程序博客网 时间:2024/06/06 16:01
Robot Instructions
#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>using namespace std;int main(){ string a[110]; int t; scanf("%d",&t); while(t--){ int n; scanf("%d",&n); int x=0; for (int i=1;i<=n;i++){ string s; cin>>s; if (s=="LEFT"){ x--; a[i]="LEFT"; } else if (s=="RIGHT"){ x++; a[i]="RIGHT"; } else{ string ss; int m; cin>>ss; scanf("%d",&m); if (a[m]=="LEFT"){ x--; a[i]="LEFT"; } else if (a[m]=="RIGHT"){ x++; a[i]="RIGHT"; } } } printf("%d\n",x); } return 0;}
阅读全文
0 0
- uva
- UVA
- UVA
- UVA
- uva
- UVA
- UVA
- UVA
- UVA
- UVA
- UVA
- UVA
- UVA
- UVA
- UVA
- UVA
- UVA
- UVA
- GCC的-fno-builtin选项
- 七层中反射+配置文件的使用
- hashmap与hashtable区别
- Javascript回调(一):简述
- 字符串函数——strcpy 、strncpy 、strcat、 strncat、 strcmp 、strncmp、 memcpy、 memmove)
- UVA
- Windows将py文件关联到pythonw.exe
- Altium Designer PCB设计规则中英对照
- 测试小故事30:软件测试会消失吗
- UVA
- SSDB及phpssdbadmin环境环境搭建(Ubuntu 14 )
- JNI例子
- 笔记_经典的冒泡法
- python enumerate用法总结