Conference
TCO05 Semi 3 · 2005-08-16 · by dgoodman
Problem Statement
Each element of the
Create a class Conference that contains a method coverage that is given n, the
number of faculty sent to the conference, and the
Constraints
- n will be between 1 and 10, inclusive.
- meetings will contain between 1 and 50 elements, inclusive.
- Each element of meetings will contain 11 characters in the form "hh:mm hh:mm"
- Each hh:mm will represent a time between 8 am and 8 pm inclusive.
- Each mm will be between 00 and 59, inclusive.
- In each element of meetings the second time will be strictly later than the first.
3
{"08:00 08:00","08:00 08:00","08:00 08:00",
"08:00 08:00","08:00 08:00"}
Returns: 3
All these meetings last all day long. Nobody can cover more than one.
2
{"09:00 08:00","08:00 12:00","12:00 08:00",
"08:00 08:00","08:00 08:00"}
Returns: 3
One person can cover the 8-12 meeting and the 12-8 meeting. The other person can cover one of the all-day meetings.
1
{"08:00 01:00","08:25 12:50","12:00 12:30",
"12:30 08:00","08:00 08:00"}
Returns: 2
10
{"08:00 08:00","08:00 08:00","08:00 08:00",
"08:00 08:00","08:00 08:00"}
Returns: 5
2
{"08:00 01:00","09:00 02:00","10:00 03:00",
"11:00 04:00","12:00 05:00","01:00 06:00"}
Returns: 3
Submissions are judged against all 109 archived test cases, of which 5 are shown here. Case numbers match the judge’s.
Language: C++17 · define a public class Conference with a public method int coverage(int n, vector<string> meetings) · 109 test cases · 2 s / 256 MB per case