PKU 1573 Robot Motion(简单模拟)】的更多相关文章

原题大意:原题链接 给出一个矩阵(矩阵中的元素均为方向英文字母),和人的初始位置,问是否能根据这些英文字母走出矩阵.(因为有可能形成环而走不出去) 此题虽然属于水题,但是完全独立完成而且直接1A还是很开心的 注意:对于形成环的情况则从进入环的交点处重新走一遍,记录步数即可 #include<cstdio> #include<cstring> int n,m,p; ][]; ][]; bool can(int x,int y) { ||x>n||y<||y>m||v…
题目代号:POJ 1573 题目链接:http://poj.org/problem?id=1573 Language: Default Robot Motion Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 14195   Accepted: 6827 Description A robot has been programmed to follow the instructions in its path. Instr…
                                                                                                               Robot Motion Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 11462   Accepted: 5558 Description A robot has been programmed to…
题目在这里 题意 : 问你按照图中所给的提示走,多少步能走出来??? 其实只要根据这个提示走下去就行了.模拟每一步就OK,因为下一步的操作和上一步一样,所以简单dfs.如果出现loop状态,只要记忆每个所到的点的第一次的步数,最后总步数减掉它即可 /************************************************************************* > File Name: poj1573.cpp > Author: YeGuoSheng >…
题目地址:http://poj.org/problem?id=1573 /* 题意:给定地图和起始位置,robot(上下左右)一步一步去走,问走出地图的步数 如果是死循环,输出走进死循环之前的步数和死循环的步数 模拟题:used记录走过的点,因为路线定死了,所以不是死循环的路只会走一次,可以区分出两个步数 注意:比较坑的是,如果不是死循环,临界(走进去就出来)步数是1:而死循环却是0. 这里WA几次... */ #include <cstdio> #include <iostream&g…
Robot Motion Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 12856   Accepted: 6240 Description A robot has been programmed to follow the instructions in its path. Instructions for the next direction the robot is to move are laid down in…
1.Link: http://poj.org/problem?id=1573 http://bailian.openjudge.cn/practice/1573/ 2.Content: Robot Motion Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 10856   Accepted: 5260 Description A robot has been programmed to follow the instru…
Robot Motion Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 12978   Accepted: 6290 Description A robot has been programmed to follow the instructions in its path. Instructions for the next direction the robot is to move are laid down in…
#define ONLINE_JUDGE #include<cstdio> #include <cstring> #include <algorithm> using namespace std; int A,B,sx,sy; char maz[101][101]; int vis[101][101]; const int dx[4]={0,1,0,-1}; const int dy[4]={-1,0,1,0}; int dir(char ch){ if(ch=='N'…
转载请注明出处:http://blog.csdn.net/u012860063? viewmode=contents 题目链接: HDU:pid=1035">http://acm.hdu.edu.cn/showproblem.php?pid=1035 POJ:   id=1573">http://poj.org/problem? id=1573 Description A robot has been programmed to follow the instruction…