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

题目链接: 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'后以这个机…
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…
链接: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 " 当出现上述情况.仅仅需输出第一次出现上述的情况 若全部指令运行完,全部机器都…
点击打开链接 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…
题目链接: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…
做的差点想吐,调来调去,编译器都犯毛病,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…
1.Link: http://poj.org/problem?id=2632 http://bailian.openjudge.cn/practice/2632/ 2.Content: Crashing Robots Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7912   Accepted: 3441 Description In a modernized warehouse, robots are used to…
题目链接: https://vjudge.net/problem/POJ-2632 题目大意: 在一个a×b的仓库里有n个机器人,编号为1到n.现在给出每一个机器人的坐标和它所面朝的方向,以及m条指令,每条指令由三部分组成:整数num代表该条指令调用的机器人的编号:字符act表示操作:其中L表示原地向左转90°,R表示原地向右转90°,F表示向前走一步:整数rep表示执行该条指令的次数.已知,当两个机器人坐标相同时他们会相撞,某一个机器人走出仓库也会撞到墙,问你能否安全执行这m条指令,如果能则输…
Crashing Robots Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8424   Accepted: 3648 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: 7394   Accepted: 3242 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: 8340   Accepted: 3607 Description In a modernized warehouse, robots are used to fetch the goods. Careful planning is needed to ensure that the robots reach their destination…
1020: Crashing Robots 时间限制(普通/Java):1000MS/10000MS     内存限制:65536KByte 总提交: 207            测试通过:101 描述 In a modernized warehouse, robots are used to fetch the goods. Careful planning is needed to ensure that the robots reach their destinations withou…
Crashing Robots Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9859   Accepted: 4209 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: 8124   Accepted: 3528 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 DescriptionIn 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 a…
Crashing Robots 题意 模拟多个机器人在四个方向的移动,检测crash robot, crash wall, OK这些状态 这是个模拟题需要注意几点: 理解转变方向后移动多少米,和转动方向多少次的区别,这里后一种,在于自己审题 crash robot 需要区别哪一个是最先找到的 代码(自己写的比较乱) int move[4][2]={{1,0},{0,1},{-1,0},{0,-1}}; //1..A or B std::map<char,int> mp={{'E',0},{'N…
题目传送门 本题知识点:模拟 模拟机器人的运作过程,分别有三种功能,L 则是左转90°,R 则是右转90°,L 则是前进1格.让我们去模拟并判断它们的状态. 输入: 第一行是测试样例 第二行分别是矩形的长.宽(比如,5 4) // 题目是讲得很清楚的 // 4 // 3 // 2 // 1 // 1 2 3 4 5 第三行分别是机器人的个数以及指令条数 接下来是先输入每个机器人的初始状态(有多少个机器人就多少行),3个数值分别对应机器人所在位置的(x, y)以及机器人所面向的方向(因为 F 指令…
Crashing Robots Time Limit: 1000MS Memory Limit: 65536K 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 cour…
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…
  Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8352   Accepted: 3613 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 cras…
题目链接. 分析: 虽说是简单的模拟,却调试了很长时间. 调试这么长时间总结来的经验: 1.坐标系要和题目建的一样,要不就会有各种麻烦. 2.在向前移动过程中碰到其他的机器人也不行,这个题目说啦:a robot always completes its move before the next one starts moving. #include <iostream> #include <cstdio> #include <cstring> using namespa…
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…
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…
Description Too worrying about the house price bubble, poor Mike sold his house and rent an apartment in a 50-floor building several months ago. This building has only one elevator because it is a so called “rotten tail building”. There are always a…
http://poj.org/problem?id=2014 嘻嘻2014要到啦,于是去做Prob.ID 为2014的题~~~~祝大家新年快乐~~ 题目大意: 给你一个最大宽度的矩形,要求把小矩形排放在内,只有当这一行小矩形的宽度超过最大宽度后,才能放入下一行. 求最后放好后的宽度和高度. (具体看题目吧,好像表述得不太清楚) 思路: 就按题目给定矩形的顺序直接来模拟就好了.. 不用旋转不用排序各种不要... #include<cstdio> #include<algorithm>…
Crossword Answers Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 869   Accepted: 405 Description A crossword puzzle consists of a rectangular grid of black and white squares and two lists of definitions (or descriptions). One list of de…
题意:如果要切断一个长度为a的木条需要花费代价a, 问要切出要求的n个木条所需的最小代价. 思路:模拟huffman树,每次选取最小的两个数加入结果,再将这两个数的和加入队列. 注意priority_queue的用法,原型: priority_queue<Type> q; priority_queue<Type,deque<Type>,Comp> q; 其中Type是类型,Comp是比较结构体,比较函数是它的括号重载,比如对int型从小到大排序的Comp结构体如下: s…