POJ 1376 Robot】的更多相关文章

Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 7866   Accepted: 2586 Description The Robot Moving Institute is using a robot in their local store to transport different items. Of course the robot should spend only the minimum time neces…
题目地址:http://poj.org/problem?id=1573 /* 题意:给定地图和起始位置,robot(上下左右)一步一步去走,问走出地图的步数 如果是死循环,输出走进死循环之前的步数和死循环的步数 模拟题:used记录走过的点,因为路线定死了,所以不是死循环的路只会走一次,可以区分出两个步数 注意:比较坑的是,如果不是死循环,临界(走进去就出来)步数是1:而死循环却是0. 这里WA几次... */ #include <cstdio> #include <iostream&g…
The Robot Moving Institute is using a robot in their local store to transport different items. Of course the robot should spend only the minimum time necessary when travelling from one place in the store to another. The robot can move only along a st…
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…
题目代号: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: 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…
                                                                                                               Robot Motion Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 11462   Accepted: 5558 Description A robot has been programmed to…
#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'…
又是被自己的方向搞混了 题意:走出去和遇到之前走过的就输出. #include <cstdlib> #include <iostream> #include<cstdio> using namespace std; #define N 110 int map[N][N],visit[N][N],n,m,flag;//n为x轴 m为y轴 int dir[][2]={{0,1},{1,0},{0,-1},{-1,0}};//e,s,w,n int setdire(char…
题意:给你一个图,求起点 到 终点的最少时间 每次有两种选择①:往前走1~3步                ②原地选择90°   费时皆是1s 图中1为障碍物,而且不能出边界.还要考虑机器人的直径 思路: bfs,但是在判断时出了点问题/(ㄒoㄒ)/,想复杂了,导致一直wr. 用vis[x][y][dir] 表示状态,即在(x,y)点的dir方向 问题: ①考虑判断条件时出现问题,开始想得太简单,后来想得太复杂= = ②最开始写的搜索部分太乱 ③题意理解不准确.. #include <iost…