simple task scheduling problem
Today we will talk about task scheduling problem using greedy thinking. In fact, greedy algorithm is quite uncommon, for most problems in our life can not be solved just by greedy algorithm. But here is one, a simple task scheduling problem. Let’s solve it!
Description:.
Suppose you have a list of work to do. For each task, it starts from b[i] and ends at e[i]. Now give you the number of the whole tasks. You’ve already know that you can not do multiple tasks at the same time, but you want to participate in the most tasks in this period of time to get more money(hhh). So, how many tasks can you participate in at most?
sample
input
5
1 3
2 5
4 7
6 9
8 10
output
3