Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

lab of Foundations of Algorithms...C++ code Courses Choosing Problem Description All university students need to register courses before the start of each semester. There are

lab of Foundations of Algorithms...C++ code

Courses Choosing

Problem Description

All university students need to register courses before the start of each semester. There are many of courses Johnson wouldl ike to take. However, there are some schedule conicts that prevent him from selecting all of them. Please write a program to help him calculate the maximum number of courses he can take.

Technical Specication

0 d 6. 0 s < t 24.

Input Format

Input consists n+1 lines. First line is an integer n that equals to the number of courses that Johnson wants to choose. The following n lines contain information about these courses. Each line consist 3 integers, d, s, and t. d equals to the day (0 is Sunday, 1 is Monday, ..., 6 is Saturday), s equals to the time the course starts (24 hours format, no leading zero, hh means begin at hh:10), t equals to the time the course ends (24 hours format, no leading zero, hh means end at hh:00).

Output Format

Single integer that equals to the maximal number of non-coliding classes.

Example

Input output

5 4

1 6 8

1 9 16

1 10 13

1 13 16

2 9 12

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Upgrading Oracle Databases Oracle Database New Features

Authors: Charles Kim, Gary Gordhamer, Sean Scott

1st Edition

B0BL12WFP6, 979-8359657501

More Books

Students also viewed these Databases questions

Question

The paleolithic age human life, short write up ?

Answered: 1 week ago