5-12 How Long Does It Take (25分)
来源:互联网 发布:mac顶端半透明 编辑:程序博客网 时间:2024/05/15 03:10
Given the relations of all the activities of a project, you are supposed to find the earliest completion time of the project.
Input Specification:
Each input file contains one test case. Each case starts with a line containing two positive integers N (≤100), the number of activity check points (hence it is assumed that the check points are numbered from 0 to N−1), and M, the number of activities. Then M lines follow, each gives the description of an activity. For the i
-th activity, three non-negative numbers are given: S[i]
, E[i]
, and L[i]
, whereS[i]
is the index of the starting check point, E[i]
of the ending check point, and L[i]
the lasting time of the activity. The numbers in a line are separated by a space.
Output Specification:
For each test case, if the scheduling is possible, print in a line its earliest completion time; or simply output "Impossible".
Sample Input 1:
9 120 1 60 2 40 3 51 4 12 4 13 5 25 4 04 6 94 7 75 7 46 8 27 8 4
Sample Output 1:
18
Sample Input 2:
4 50 1 10 2 22 1 31 3 43 2 5
Sample Output 2:
Impossible
- 时间限制:400ms
- 内存限制:64MB
- 代码长度限制:16kB
- 判题程序:系统默认
- 作者:陈越
- 单位:浙江大学
- 5-12 How Long Does It Take (25分)
- 5-12 How Long Does It Take (25分)
- 08-图8 How Long Does It Take (25分)
- 08-图8 How Long Does It Take (25分)
- 08-图8 How Long Does It Take (25分)
- 08-图8 How Long Does It Take (25分)
- PAT--How Long Does It Take (25)
- How Long Does It Take
- PTA—08-图8 How Long Does It Take (25分)
- MOOC浙大数据结构 — 08-图8 How Long Does It Take (25分)
- 08-图8 How Long Does It Take (25分)
- 08-图8 How Long Does It Take(25 分)
- 06-图7. How Long Does It Take (25)
- 06-图7. How Long Does It Take (25)
- PAT How Long Does It Take (25) (拓扑排序)
- mooc -- 06-4 How Long Does It Take
- How long does it take to make a context switch?
- 08-图8 How Long Does It Take
- 【鸟哥的linux私房菜-学习笔记】档案与文件系统的压缩与打包
- 矛与盾的世界
- CMD 和 Git 中的代理设置
- iOS Hit-Testing
- Android修改TitleBar标题栏详解
- 5-12 How Long Does It Take (25分)
- Intel 82599 ixgbe & ixgbevf CNA 卡驱动分析02——VF/PF/MailBox
- dba三个一切
- 13 Machine Learning Data Set Collections(13个机器学习数据集)
- 数据库增删改查基础操作
- Hadoop启动报Error: JAVA_HOME is not set and could not be found解决办法
- JAVA容器
- window7 32位系统 VC2010 opencv2.4.11 配置
- 倍数提高工作效率的 Android Studio 奇技