poj-1083-Moving Tables(hdu-1050)】的更多相关文章

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…
1.链接地址: http://poj.org/problem?id=1083 http://bailian.openjudge.cn/practice/1083/ 2.题目: 总时间限制: 1000ms 内存限制: 65536kB 描述 The famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure. The floor…
http://poj.org/problem?id=1083 这道题题意是有若干段线段,每次要求线段不重叠地取,问最少取多少次. 因为这些线段都是必须取的,所以需要让空隙最小 思路: 循环直到线段全部取完,对于某个刚取得线段ij,下一个线段km取起点k尽量靠近j且满足k>j的.记录循环次数cnt,答案是cnt*10 注意: 房间是相对的,也就是说对于奇数房间号,利用的走廊相当于对应的偶数房间号开始的那一段路程, 一段路程的开头不能是另外一段路程的结尾. #include <cstdio>…
题意:一个建筑物里有400个房间,房间都在一层里,在一个走廊的两侧,如图,现在要搬n张桌子,告诉你每张桌子是从哪个屋搬到哪个屋,搬桌子的线路之间不可以有重叠,问最少搬几次. 解法:贪心.一开始觉得只要排个序,然后按顺序一次一次的分配就可以了……但是wa了……百度之后知道只要看哪块地的使用次数最多就是答案……于是A了之后出随机数据对拍,发现确实一开始的贪心是错的……嘤嘤嘤 代码: #include<stdio.h> #include<iostream> #include<alg…
题目链接:http://poj.org/problem?id=1083 题意: 走廊两边分别有200个房间,一边连续编号为1-399的奇数,另一边是2-400的偶数, 如果从房间 i 移动桌子到房间 j , 由于走廊宽度只能允许一次通过一张桌子, 那么给定一些移动方案, 求最小的移动时间(移动一次需要10分钟.). 分析: 每次移动都不应该占同样的走廊, 如果记录移动桌子时走廊的每段最多会被占多少次, 那么这个最大值就是最小移动次数. - z[MAXN], z[i] 表示走廊段被占用的次数. 如…
题意:给你n个凳子,接着告诉你一个凳子从a房间到b房间,运输时间为10分钟,走廊很窄能通过一张凳子,当然不堵塞的话能同时扮凳子,问最小花费多少时间 因为数据很小就直接用数组统计了,a,b如果是奇数的话就变成偶数(这个不冲突),直接累加过去. #include <iostream> #include<cstdio> #include<cmath> #include<cstring> using namespace std; #define N 410 int…
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/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…
http://acm.hdu.edu.cn/showproblem.php? pid=1050 Moving Tables Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 18850    Accepted Submission(s): 6440 Problem Description The famous ACM (Advanced…
pid=1050">Moving Tables Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 19156    Accepted Submission(s): 6532 Problem Description The famous ACM (Advanced Computer Maker) Company has rented…
 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/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…
题目连接:2326 - Moving Tables 题目大意:在一个走廊上有400个教室, 先在有一些桌子要移动, 每次移动需要十分钟, 但是不同房间的桌子可以在同一个十分钟内移动,只要走廊没有被占用就可以, 注意教室序号1 和 2 是在对面. 注意:给出的区间没有分左边或者是右边比较大. 解题思路:区间覆盖问题, 将所有给出的区间处理一下, 去除对面房间这样的情况. 让后将区间按照l 和 r 的值进行排序, 然后看进行几次区间覆盖可以使得所有区间均被用上. #include <stdio.h>…
解题思路: 这种做法是基于hdu2037的做法上考虑的,找出所有可以同时搬运的桌子,然后就很方便求出最短总时间. 还有一种更简单的做法是直接遍历一遍找出与别的重复次数最多的那片区域,重复次数*10就可以得到结果. Moving Tables Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 28033    Accepted Submis…
B - Moving Tables Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Description The famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure.  The fl…
POJ 2342 Anniversary party / HDU 1520 Anniversary party / URAL 1039 Anniversary party(树型动态规划) Description There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of emp…
POJ1083 Moving Tables Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 35297   Accepted: 11774 Description The famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure. The floor…
POJ 2711 Leapin' Lizards / HDU 2732 Leapin' Lizards / BZOJ 1066 [SCOI2007]蜥蜴(网络流,最大流) Description Your platoon of wandering lizards has entered a strange room in the labyrinth you are exploring. As you are looking around for hidden treasures, one of…
Moving Tables Problem 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 north side and south side along the corridor. Recently the…
Moving Tables Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 40796    Accepted Submission(s): 13405 Problem Description The famous ACM (Advanced Computer Maker) Company has rented a floor of a…
Moving Tables Time Limit: 2000ms Memory Limit: 65536KB This problem will be judged on ZJU. Original ID: 102964-bit integer IO format: %lld      Java class name: Main   The famous ACM (Advanced Computer Maker) Company has rented a floor of a building…
POJ - 3847 Moving to Nuremberg 题意:一张无向有权图,包括边权和点权,求一点,使得到其他点的点权*边权之和最小 思路: #pragma comment(linker, "/STACK:1000000000") #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <vector>…
定义&&概念: 啥是并查集,就是将所有有相关性的元素放在一个集合里面,整体形成一个树型结构,它支持合并操作,但却不支持删除操作 实现步骤:(1)初始化,将所有节点的父亲节点都设置为自己,例如pre[1]=1(2)合并,将一个元素或者一集合(两者间有联系)合并到另外一个集合(元素)里面,谁是谁的父亲节点不需要过多在意,视题意而定.(3)查找,在合并时需要运用到查找操作,即查找该元素的父节点,尽量使用路径压缩,可以使并查集更加高效,一旦使用了路径压缩,查询时就会将该查询元素到父亲的边改为直接连…
Moving Tables Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 45555    Accepted Submission(s): 14817 Problem Description The famous ACM (Advanced Computer Maker) Company has rented a floor of a…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1050 这道题目隔了很久才做出来的.一开始把判断走廊有重叠的算法都想错了.以为重叠只要满足,下一次moving的起始room小于或等于上一次moving的结束room则证明有重复.这样只能保证局部不能同时进行moving,但是根本得不出其他moving哪些是可以同时进行搬动的. 正确的思路是,统计最大的重叠数,再乘以10即可.具体做法:把每个房间之间的走廊作为一个统计单位,当所有的办公桌都搬运完成之后…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1050 AC code: #include<stdio.h> #include<string.h> int m[210]; int main(void) { int t,n,i,j,st,en,ma; scanf("%d",&t); while(t--) { memset(m,0,sizeof(m)); scanf("%d",&n)…
Problem 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 north side and south side along the corridor. Recently the Company made…
http://acm.hdu.edu.cn/showproblem.php?pid=1050 这个题我首先直接用的常规贪心,用的和那个尽可能看更多完整节目那种思路.但是.......一直WA....T_T.... 后来在网上搜了一下这个题,发现好多人都有问题,都没有求出来,基本上都用的对尾部排序求的方法. 其实这个题因为是两排房间,所以1和2公用一个走廊,其中一个在需要移动的时候宁外一个还是不能移动. 所以我后面改了思路,直接改成了用两次排序直接找里面重叠部分最多的.(尾部排序的时候也要处理走廊…