PROGRAMMING:Swan College Club Recruitment
Swan college community recruitment, recruitment talks scattered in different periods of time, freshmen Xiaohua want to know how many recruitment talks she can participate in at most (can't interrupt or leave when attending a recruitment talk).
[problem description] this problem is to schedule several competing recruitment activities, which all require the exclusive use of a public resource (small flower). The goal of scheduling is to find the largest set of compatible activities.
The activity selection problem is to select the largest subset of compatible problems.
Warm tips: all activities should be arranged in ascending order according to the end time, and then the possible time combinations should be selected, and the maximum number of combinations should be calculated. Using the sort function of qsort() is a good choice. The function prototype of qsort is as follows:
void qsort(void*base,size_ t num,size_ t width,int(__ cdecl*compare)(const void*,const void*));
Function: use quick sort routine to sort. Header file: stdlib. H
Parameters: 1. The first address of the array to be sorted; 2. The number of elements to be sorted in the array; 3. The occupied space of each element; A pointer to a function that determines the order of sorting
###Input format:
The first line is n, which means that there are n recruitment meetings. The next line is n, and two integers in each line indicate the start time and end time, which are represented by the number of hours starting from 0 o'clock on the first day of the recruitment meeting (24-hour system). n <= 1000 。
###Output format:
The largest number of job fairs.
###Input example:
Here is a set of inputs. For example:
```in
three
9 10
10 20
8 15
```
###Output example:
The corresponding output is given here. For example:
```out
two
```
answer:If there is no answer, please comment
[problem description] this problem is to schedule several competing recruitment activities, which all require the exclusive use of a public resource (small flower). The goal of scheduling is to find the largest set of compatible activities.
The activity selection problem is to select the largest subset of compatible problems.
Warm tips: all activities should be arranged in ascending order according to the end time, and then the possible time combinations should be selected, and the maximum number of combinations should be calculated. Using the sort function of qsort() is a good choice. The function prototype of qsort is as follows:
void qsort(void*base,size_ t num,size_ t width,int(__ cdecl*compare)(const void*,const void*));
Function: use quick sort routine to sort. Header file: stdlib. H
Parameters: 1. The first address of the array to be sorted; 2. The number of elements to be sorted in the array; 3. The occupied space of each element; A pointer to a function that determines the order of sorting
###Input format:
The first line is n, which means that there are n recruitment meetings. The next line is n, and two integers in each line indicate the start time and end time, which are represented by the number of hours starting from 0 o'clock on the first day of the recruitment meeting (24-hour system). n <= 1000 。
###Output format:
The largest number of job fairs.
###Input example:
Here is a set of inputs. For example:
```in
three
9 10
10 20
8 15
```
###Output example:
The corresponding output is given here. For example:
```out
two
```
answer:If there is no answer, please comment