|
|
вернуться в форумIt is easy, just sort and one linear cycle 1. Sort it by endTime, if endTime equals another endTime then sort them by startTime. 2. Open one iteration from 2 to n, init just check that, is endTime<starTime, if so then ans++; 3. print ans; endTime and startTimes is one array with unchanged same index... Sorry for poor English
Re: It is easy, just sort and one linear cycle Послано ELDVN 16 ноя 2015 12:37 Re: It is easy, just sort and one linear cycle I don't think sorting by startTime is necessary. I think we should reverse-sort by startTime. |
|
|