文件名称:huichanganpaiwenti
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:1.2kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
会场安排问题
Descr iption
假设要在足够多的会场里安排一批活动,并希望使用尽可能少的会场。设计一个有效的
贪心算法进行安排。(这个问题实际上是著名的图着色问题。若将每一个活动作为图的一个
顶点,不相容活动间用边相连。使相邻顶点着有不同颜色的最小着色数,相应于要找的最小
会场数。)
编程任务:
对于给定的k个待安排的活动,编程计算使用最少会场的时间表。
Input
由文件input.txt给出输入数据。第一行有1 个正整数k,表示有k个待安排的活动。接
下来的k行中,每行有2个正整数,分别表示k个待安排的活动开始时间和结束时间。时间
以0 点开始的分钟计。
Output
将编程计算出的最少会场数输出到文件output.txt。
Sample Input
5
1 23
12 28
25 35
27 80
36 50
Sample Output
3
-Venue arrangements
Descr iption
Assumed to be a sufficient number of arrangements for a number of activities inside the venue, and hoped to use as little as possible venue. To design an effective
Greedy algorithm to arrange. (This problem is actually well-known graph coloring problem. If we each activity as a graph
Vertex, between incompatible activities connected with the edge. So that adjacent vertices have different colors with minimum chromatic number, corresponding to the minimum to find
Site number. )
Programming tasks:
For a given k were to be arranged activities, calculated using the programming schedule for at least the venue.
Input
Given input data from the file input.txt. The first line has a positive integer k, that there are k-to be arranged activities. Then
K down the line, each line has two positive integers k, respectively, the activities were to be arranged start time and end time. Time
To 0:00 start of the minutes.
Output
Will be programmed to calculate th
Descr iption
假设要在足够多的会场里安排一批活动,并希望使用尽可能少的会场。设计一个有效的
贪心算法进行安排。(这个问题实际上是著名的图着色问题。若将每一个活动作为图的一个
顶点,不相容活动间用边相连。使相邻顶点着有不同颜色的最小着色数,相应于要找的最小
会场数。)
编程任务:
对于给定的k个待安排的活动,编程计算使用最少会场的时间表。
Input
由文件input.txt给出输入数据。第一行有1 个正整数k,表示有k个待安排的活动。接
下来的k行中,每行有2个正整数,分别表示k个待安排的活动开始时间和结束时间。时间
以0 点开始的分钟计。
Output
将编程计算出的最少会场数输出到文件output.txt。
Sample Input
5
1 23
12 28
25 35
27 80
36 50
Sample Output
3
-Venue arrangements
Descr iption
Assumed to be a sufficient number of arrangements for a number of activities inside the venue, and hoped to use as little as possible venue. To design an effective
Greedy algorithm to arrange. (This problem is actually well-known graph coloring problem. If we each activity as a graph
Vertex, between incompatible activities connected with the edge. So that adjacent vertices have different colors with minimum chromatic number, corresponding to the minimum to find
Site number. )
Programming tasks:
For a given k were to be arranged activities, calculated using the programming schedule for at least the venue.
Input
Given input data from the file input.txt. The first line has a positive integer k, that there are k-to be arranged activities. Then
K down the line, each line has two positive integers k, respectively, the activities were to be arranged start time and end time. Time
To 0:00 start of the minutes.
Output
Will be programmed to calculate th
(系统自动生成,下载前可以参看下载内容)
下载文件列表
huichanganpaiwenti.cpp
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.