AverageProblem
SRM 356 · 2007-07-02 · by Pawa
Problem Statement
You are given a
Constraints
- marks will contain between 1 and 50 elements, inclusive.
- Each element of marks will contain between 5 and 50 characters, inclusive.
- Each element of marks will be a single space separated list of numbers, where each number is between 0 and 10, inclusive, contains no extra leading zeroes, and contains exactly one decimal point followed by exactly 3 digits.
- marks will contain between 1 and 50 numbers, inclusive.
Statement by TopCoder, Inc. — view the original on the archive.
{"0.000"}
Returns: 1
There will always be at least one participant. In this case, the smallest number of participants that could have produced this result is 1.
{"0.500 0.250", "0.125"}
Returns: 8
{"0.500","0.300"}
Returns: 10
{"0.500","0.301"}
Returns: 106
{"0.001", "0.002"}
Returns: 667
Submissions are judged against all 171 archived test cases, of which 5 are shown here. Case numbers match the judge’s.
Language: C++17 · define a public class AverageProblem with a public method int numberOfParticipants(vector<string> marks) · 171 test cases · 2 s / 256 MB per case