poj 2632 Crashing Robots_模拟】的更多相关文章

做的差点想吐,调来调去,编译器都犯毛病,wlgq,幸好1a. 题意:给你机器人怎走的路线,碰撞就输出 #include <cstdlib> #include <iostream> #include<cstdio> #include<cstring> #define N 110 using namespace std; struct Rob{ int x,y,dire;//dire 1为e,2为s,3为w,4为n }rob[N]; int n,m,a,b,ma…
题目链接: http://poj.org/problem?id=2632 题目描述: 有一个B*A的厂库,分布了n个机器人,机器人编号1~n.我们知道刚开始时全部机器人的位置和朝向,我们可以按顺序操控机器人,没有两个机器人可以同时执行命令.如果机器人走到厂库边界,他将碰到墙,如果两个机器人走到同一位置,则表示他们两个相撞.问m个命令内最先发生的碰撞,如果没有碰撞输出“OK”. 解题思路: 由图可知,本题的矩阵与平时的不太一样,所以我们在对厂库进行操作的时候,可以先把厂库顺时针旋转90°,当然,方…
题目链接:http://poj.org/problem?id=2632 先话说昨天顺利1Y之后,直到今天下午才再出题 TAT,真是刷题计划深似海,从此AC是路人- - 本来2632是道略微恶心点的模拟,但毕竟是模拟,一般模拟都是仅仅要演示样例过了基本就AC了.但这个题非常特殊 我開始的时候一直跑不出測试演示样例.才发现题目中的插图和我构想的坐标系是不一样的(看来还不能轻易忽视掉插图啊) watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvY29kZWh5cG…
http://poj.org/problem?id=2632 #include<cstdio> #include <cstring> #include <algorithm> using namespace std; int A,B,n,m; int robot[101][3]; char rbuff[10]; int dir[255]; const int dx[4]={0,1,0,-1}; const int dy[4]={1,0,-1,0}; int action…
题目地址:http://poj.org/problem?id=2632 /* 题意:几个机器人按照指示,逐个朝某个(指定)方向的直走,如果走过的路上有机器人则输出谁撞到:如果走出界了,输出谁出界 如果以上都没发生,则输出OK 模拟题:无算法,按照条件编写几个函数和判断条件 注意:1. 关于绕转,只要模拟人的转圈方向,比如向右转就向右手边转(优化:当超过4次则对4取模) 2. 有先撞墙还是先撞机器人的问题(每一次'F'后都要及时判断是否OK) 3. 撞哪个机器人也有先来后到的顺序('F'后以这个机…
链接:poj 2632 题意:在n*m的房间有num个机器,它们的坐标和方向已知,现给定一些指令及机器k运行的次数, L代表机器方向向左旋转90°,R代表机器方向向右旋转90°,F表示前进,每次前进一米 若前进时机器i撞到机器j,输出"Robot i crashes into robot j " 若机器走出了n*m的房间,输出"Robot i crashes into the wall " 当出现上述情况.仅仅需输出第一次出现上述的情况 若全部指令运行完,全部机器都…
题目链接:http://poj.org/problem?id=2632 题目大意:题意简单,N个机器人在一个A*B的网格上运动,告诉你机器人的起始位置和对它的具体操作,输出结果: 1.Robot i crashes into the wall, if robot i crashes into a wall. (A robot crashes into a wall if Xi = 0, Xi = A + 1, Yi = 0 or Yi = B + 1.) 撞墙 2.Robot i crashes…
Crashing Robots Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 6599   Accepted: 2854 Description In a modernized warehouse, robots are used to fetch the goods. Careful planning is needed to ensure that the robots reach their destination…
点击打开链接 Crashing Robots Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 6655   Accepted: 2886 Description In a modernized warehouse, robots are used to fetch the goods. Careful planning is needed to ensure that the robots reach their dest…
Description In a modernized warehouse, robots are used to fetch the goods. Careful planning is needed to ensure that the robots reach their destinations without crashing into each other. Of course, all warehouses are rectangular, and all robots occup…