zstu.2512. Moving Tables(贪心)
Moving Tables
Time Limit: 1 Sec Memory Limit: 64 MB Submit: 1182 Solved: 563
Description

The floor has 200 rooms each on the north side and south side along the corridor. Recently the Company made a plan to reform its system. The reform includes moving a lot of tables between rooms. Because the corridor is narrow and all the tables are big, only one table can pass through the corridor. Some plan is needed to make the moving efficient. The manager figured out the following plan: Moving a table from a room to another room can be done within 10 minutes. When moving a table from room i to room j, the part of the corridor between the front of room i and the front of room j is used. So, during each 10 minutes, several moving between two rooms not sharing the same part of the corridor will be done simultaneously. To make it clear the manager illustrated the possible cases and impossible cases of simultaneous moving.

For each room, at most one table will be either moved in or moved out. Now, the manager seeks out a method to minimize the time to move all the tables. Your job is to write a program to solve the manager’s problem.
Input
Output
Sample Input
3
4
10 20
30 40
50 60
70 80
2
1 3
2 200
3
10 100
20 80
30 50
Sample Output
10
20
30
一开始一直以为要把那么多椅子搬完,应该按照谁结束时间最早来排序,结果wa到死。
后来终于醒悟过来orz,要把所有椅子尽可能搬完,应该尽可能利用他给这段区间。(就是说令每一次10分钟的搬运,所使用的区间尽可能去占满整段区间)
所以按照开始的位置进行排布即可。
zstu.2512. Moving Tables(贪心)的更多相关文章
- Moving Tables(贪心或Dp POJ1083)
Moving Tables Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 28304 Accepted: 9446 De ...
- HDU1050(Moving Tables:贪心算法)
解题思路: 这种做法是基于hdu2037的做法上考虑的,找出所有可以同时搬运的桌子,然后就很方便求出最短总时间. 还有一种更简单的做法是直接遍历一遍找出与别的重复次数最多的那片区域,重复次数*10就可 ...
- hdu_1050 Moving Tables 贪心
Moving Tables Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Tot ...
- UVAlive 2326 Moving Tables(贪心 + 区间问题)
The famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in ...
- --hdu 1050 Moving Tables(贪心)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1050 AC code: #include<stdio.h> #include<str ...
- POJ 1083 && HDU 1050 Moving Tables (贪心)
Moving Tables Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) To ...
- hdoj 1050 Moving Tables【贪心区间覆盖】
Moving Tables Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Tot ...
- HDOJ 1050 Moving Tables
Moving Tables Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Tot ...
- Moving Tables
Moving Tables Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Total ...
随机推荐
- Windows_7_休眠按钮没有了_如何找回?
1. 在运行中输入: powercfg -h on或者在命令行下输入: powercfg.exe /hibernate on注意:执行这个命令需要管理员权限. “休眠”回来了 2. 还是没 ...
- Git工具:Widows下的使用(提交到Github)
2016年12月9日17:07:07 Git工作原理 http://deweixu.me/2016/11/05/how-git-works/ 2016年12月1日14:25:23 ---------- ...
- Beta版本冲刺第六天 12.12
一.站立式会议照片: 二.项目燃尽图: Android端 后台 三.项目进展: 成 员 昨天完成任务 今天完成任务 明天要做任务 问题困难 心得体会 胡泽善 邮箱验证和用户评价的填写 用户评价的查看以 ...
- python 基于windows环境的ftp功能
描述: 1.基于备份服务器部署的py程序,将需要备份主机目录下的内容下载至备份服务器(服务端和远端都是windows server 2008) 2.py程序部署在windows服务器,后台运行,基于b ...
- mysql使用索引优化查询效率
索引的概念 索引是一种特殊的文件(InnoDB数据表上的索引是表空间的一个组成部分),它们包含着对数据表里所有记录的引用指针.更通俗的说,数据库索引好比是一本书前面的目录,能加快数据库的查询速度.在没 ...
- js001-JavaScript简介
js001-JavaScript简介 1. JavaScript实现 JavaScript 的三个重要组成部分如下图 1.1.ECMAScript 1.1.1 版本 ...
- asp.net与Matlab类型转换(待补全)
上上篇的博客已经提到如何配置环境,即如何在asp.net中调用matlab生成的dll文件.这篇博客打算做个笔记,那就是matlab和C#数据类型如何转换.随着需求的增加,我会不断增加新的类型转换. ...
- Redis学习-开始
C:\Program Files\Redis\redis-cli.exe 使用servicestack.redis class Program { static void Main(string[] ...
- UIView UIwindow
UI:用户界面,用户能看到的各种各样的页面元素 UIview :代表屏幕上的一个矩形区域,管理界面上的内容 创建UIview 1.开辟空间并初始化视图(初始化时,给出视图位置和大小 2.对 ...
- MySQL学习笔记——索引和视图
索引(index)和管理索引 模式中的一个数据库对象 作用:在数据库中用来加速对表的查询 创建:自动在主键和唯一键上面创建索引 通过使用快速路径访问方法快速定位数据,减少了磁盘的I/O 与表独立存放, ...