« Problem description: Suppose you want to arrange a number of activities in enough venues, and hope to use as few venues as possible. Design an effective greedy algorithm to arrange them. (This problem is actually the famous graph coloring problem. If each activity is regarded as a vertex of the graph, incompatible activities are connected by edges. The minimum number of colorings that make adjacent vertices colored with different colors corresponds to the minimum number of venues to be found.)« Programming task: For a given k activities to be arranged, program to calculate the schedule that uses the least venues. « Data input: The input data is given by the file input.txt. The first line has a positive integer k, indicating that there are k activities to be arranged. In the next k lines, each line has 2 positive integers, which represent the start time and end time of the k activities to be arranged. The time is measured in minutes starting from 0 o\'clock. « Result output: The minimum number of venues calculated by programming is output to the file output.txt.
You Might Like
Recommended ContentMore
Open source project More
Popular Components
Searched by Users
Just Take a LookMore
Trending Downloads
Trending ArticlesMore