OpenJudge/Poj 1083 Moving Tables】的更多相关文章

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): 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…