Answered step by step
Verified Expert Solution
Question
1 Approved Answer
pls using c++ (structures) and without using library pls no limit exceed A young programmer wrote his first testing system. He was so happy it
pls using c++ (structures) and without using library pls no limit exceed
A young programmer wrote his first testing system. He was so happy it compiled that he invited his school friends to his own contest. But at the end of the tour it turned out that the system can't sort the teams in the results table properly. Help the programmer to write the correct implementation of the sorting. The teams should be sorted by the next criteria: 1) By the quantity of solved tasks in descending order 2) When the quantities of solved tasks are equal by the penalty time in ascending order 3) When both quantities of solved tasks and penalty times are equal - by the indices of teams in ascending order. You should use structures while completing this task. Input: The first line contains a natural n (1sns 105) - the quantity of teams participating in the contest. The next n lines contain two numbers S - the quantity of solved tasks (0 s Ss 100) and the penalty time T (1 s T s 106) of the ith team. Output: n numbers - the indices of teams in sorted order. Example: Input Output 5 5 2 1 3 4 3 50 5 720 1 7 08 8 500Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started