Moving Tables POJ - 1083 (思维)】的更多相关文章

题目大意 在一层楼上推桌子,每个空间一次只能推1种桌子,且消耗十分钟.可以同时推多个桌子,但是他们所占的空间不能是相交的如图 解法 真的很考验思维能力,首先考虑到这个走廊是有两排的,我瞬间想到了宿舍楼... 发现1 2是对着的3 4是对着的一个空间而2 3是两个空间这该怎么办好呢? 我们可以把他们化成1 2这种格式,即奇数左边界偶数右边界,即小的如果是偶数那么-1大的边界如果是奇数那么加一2 3可以化解成1 4是两个空间了,然后计算最大重复空间即可了 代码 #include <iostream>…
题目链接:http://poj.org/problem?id=1083 题目大意:走廊上的房间如下图设置,现在有n个移动桌子的任务,把桌子从xi移动到yi(整个过程中会占用xi到yi房间之间的走廊),每次移动10分钟,可以同时进行但走廊只有一个桌子宽(即不能共用走廊).问最少多少分钟. 我们可以把移动桌子看成一个区间,有重叠部分的区间是不可以同时进行的.所以问题转换为了求区间重叠的最大个数.因为如图的房间设置,我们可以把奇数看做偶数(1看做2,3看做4,2k+1看做2k+2).于是我们的数就变为…
Moving Tables Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 20302    Accepted Submission(s): 6889 Problem Description The famous ACM (Advanced Computer Maker) Company has rented a floor of a…
 Moving Tables Time Limit: 1 Sec  Memory Limit: 64 MB Submit: 1182  Solved: 563 Description The famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure. The floor has 200 rooms each on the…
Moving Tables Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 28304   Accepted: 9446 Description The famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure. The floor has 200…
Moving Tables Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 14418    Accepted Submission(s): 4939 Problem Description The famous ACM (Advanced Computer Maker) Company has rented a floor of a b…
Moving Tables Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 20344    Accepted Submission(s): 6900 Problem Description The famous ACM (Advanced Computer Maker) Company has rented a floor of a…
Moving Tables Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 21   Accepted Submission(s) : 11 Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description The famous ACM (Advance…
Moving Tables Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 24316    Accepted Submission(s): 8053 Problem Description The famous ACM (Advanced Computer Maker) Company has rented a floor of a b…
题目连接:2326 - Moving Tables 题目大意:在一个走廊上有400个教室, 先在有一些桌子要移动, 每次移动需要十分钟, 但是不同房间的桌子可以在同一个十分钟内移动,只要走廊没有被占用就可以, 注意教室序号1 和 2 是在对面. 注意:给出的区间没有分左边或者是右边比较大. 解题思路:区间覆盖问题, 将所有给出的区间处理一下, 去除对面房间这样的情况. 让后将区间按照l 和 r 的值进行排序, 然后看进行几次区间覆盖可以使得所有区间均被用上. #include <stdio.h>…