JudgedScoring
Rookie SRM 3 · 2021-03-05 · by erinn
Problem Statement
You are competing in an event where the score is determined by a panel of at least three judges. Each judge does their scoring independently. To determine your overall score, the highest and lowest scores are discarded, and all remaining scores are summed together.
Given the
Constraints
- scores will contain between 3 and 50 elements, inclusive.
- Each element of scores will be between 0 and 100, inclusive.
{ 5, 3, 2, 4 }
Returns: 7
The low score of 2 and the high score of 5 are ignored. Your overall score is therefore 3 + 4 = 7.
{ 1, 1, 2, 3, 4 }
Returns: 6
Note that if two or more scores are tied for being the lowest (or highest) only one gets ignored.
{ 18, 47, 23, 36, 12 }
Returns: 77
{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }
Returns: 44
{ 1, 1, 1 }
Returns: 1
Submissions are judged against all 6 archived test cases, of which 5 are shown here. Case numbers match the judge’s.
Language: C++17 · define a public class JudgedScoring with a public method int overallScore(vector<int> scores) · 6 test cases · 2 s / 256 MB per case