Skip to content

Commit 0fc6c92

Browse files
changes to Javaline Qualification
1 parent 2cc6516 commit 0fc6c92

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

CodeChef/JavelinQualification.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
/*
2+
There are N players with IDs from 1 to N, who are participating in the Javelin throw competition which has two rounds. The first is the qualification round, followed by the final round. The qualification round has gotten over, and you are given the longest distance that each of the N players has thrown as A1,A2,…,AN. Now, the selection process for the final round happens in the following two steps:
3+
4+
If the longest throw of a player in the qualification round is greater than or equal to the qualification mark of M cm, they qualify for the final round.
5+
6+
If after step 1, less than X players have qualified for the finals, the remaining spots are filled by players who have thrown the maximum distance among the players who have not qualified yet.
7+
8+
You are given the best throws of the N players in the qualification round A1,A2,…,AN and the integers M and X. Print the list of the players who will qualify for the finals in increasing order of their IDs.
9+
10+
Sample Input 1
11+
3
12+
3 8000 2
13+
5000 5001 5002
14+
3 5000 2
15+
7999 7998 8000
16+
4 6000 3
17+
5999 5998 6000 6001
18+
19+
Sample Output 1
20+
2 2 3
21+
3 1 2 3
22+
3 1 3 4
23+
*/
24+
125
import java.util.*;
226

327
public class JavelinQualification

0 commit comments

Comments
 (0)