转载请注明出处: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…
题目链接:https://cn.vjudge.net/problem/HDU-1035 水题 代码 #include <cstdio> #include <map> int height, width, sp, dir[4][2]={1, 0, 0, -1, -1, 0, 0, 1}; std::map<char, int> todir; char map[15][15]; int solve(int x, int y, int step, int vis[][15],…
Robot Motion Problem 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 a grid. The possible instructions are  N north (up the page) S south (down…
http://acm.hdu.edu.cn/showproblem.php?pid=1035 Robot Motion Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5591    Accepted Submission(s): 2604 Problem Description A robot has been programmed t…
Robot Motion Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 8180    Accepted Submission(s): 3771 Problem Description A robot has been programmed to follow the instructions in its path. Instruc…
题目链接: https://vjudge.net/problem/POJ-1573 题目大意: 有一个N*M的区域,机器人从第一行的第几列进入,该区域全部由'N' , 'S' , 'W' , 'E' ,走到某个区域的时候只能按照该区域指定的方向进行下一步,问你机器人能否走出该片区域,若不能,输入开始绕圈的步数和圈的大小. 思路: 一开始一直WA,后来发现是因为vis数组的问题,这里设置的vis数组表示到该点走的步数,最开始是0步,这和初始化是0步是一样的,会导致如果再次走到这个点,就会判断成该点…
题目链接. 分析: 很简单的一道题, #include <iostream> #include <cstring> #include <cstdio> #include <cstdlib> #include <stack> #include <cmath> #include <queue> using namespace std; ; , , , };//上右下左 , , , -}; char G[maxn][maxn];…
Problem 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 a grid. The possible instructions are N north (up the page)S south (down the page)E east…
#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'…
Robot Motion Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 12507   Accepted: 6070 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…