Question: Hello, please help me with my data structure using C++ programming language. Please do not use the library bits/stdc++.h, conio.h and limit.h . Thanks a
Hello, please help me with my data structure using C++ programming language. Please do not use the library bits/stdc++.h, conio.h and limit.h. Thanks a lot!


Train stations Description Along a unidirectional railway (i.e. all the trains run in same direction), there are n train stations numbered 1. .. n. All the stations have their own rank, the lowest of which is ranked 1. Currently, there are some trains running on this railway. All of the trains should fulfill such a requirement: If this train stops at station , it should also stop at all the stations between start station and destination station (these two included) that have a rank not lower than station 's rank. For example, the table below shows a running schedule of 5 trains. In the table, D, S, F stand for departure station, stop station, final station respectively. Train 1, 2, 3 and 4 all fulfill the requirement. However, train 5 stops at station 3 (rank 2) but doesn't stop at station 6 (also rank 2), so it doesn't fulfill the requirement. The number of 1 2 3 4 6 7 8 train station The level of 3 2 3 2 3 train station Train 1 D- - - S S F Train 2 D S + F Train 3 D - + + + S + + + + F Train 4 D S S S F Train 5 D S + F Now provide the schedule of m trains, all of which fulfill the requirement. Please calculate at least how many different ranks can be assigned to these n stations. Input The first line contains two integers n, m, separated by a space. In the following m lines, the i-th line (1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
