n no. of people participate in a coding marathon where they were asked to solve some problems. each problem carried 1 mark and the end of the marathon the total marks that each person achieved was calculated write a program
Answers
Answer:
There are N participants of cycle marathon which aims at "Run for Health". All the participants need to reach same destination. Participant depart one by one as specified by the array S where index i is the departure number of ith participant and Si is the speed which the participant will maintain throughout his journey. Also, there are two paths available for the participants and for one particular path all the participants must be in a single straight line. Also an participant i will be happy only if all the participants in his path and ahead of it are moving at a speed greater than or equal to his speed because only then it wouldn’t have to slow its speed during its course of journey. Schedule the departure so that the number of happy participants are maximum.
Consider no collision/overtake.
Assume the inital and destination point of marathon to be very very far.
INPUT FORMAT
First line consists of a single integer N denoting the number of participants
Next line consists of N space separated integers with ith integer denoting Si , the speed of ith participant
OUTPUT FORMAT
Print a single integer denoting the maximum number of happy participant that can be obtained by some scheduling.
CONSTRAINTS
1≤ N ≤ 5000
1≤ Si ≤ 109
SUBTASKS
1≤ N,Si ≤100 ( 20 Points)
Original Constraints (80 Points