# IPCTRAIN not getting tutorial explanation

can any one please explain the tutorial sol. provided by admin, actually am not able to understand the explanation.

In simple words if I say, You iterate over days and if some teacher comes on ith day then just make priority queue according to sadness and put that teacher in that. And choose teacher with highest sadness on that day from same priority queue. Remember to remove teacher from priority queue if number of lectures he has to give is completed. Finally after n days just take sum of what is remaining in priority queue. Basically I am just trying to choose a teacher with highest sadness on ith day(among who have come till now), You can say it a Greedy approach.

I hope this will help.

1 Like

In simple terms, you can only hold 1 seminar a day, any day from the arrival date up to the end.

If a man with high sadness value couldn’t have his lecture, the sadness value increases by S multiplied by the number of lectures he couldn’t do.

You must minimize the sadness value, I don’t know, probably by accommodating the ones with high sadness values if several lecturers overlaps on a fixed range of dates.

For image, imagine an array whose size is the number of days. each cell can only hold a single lecturer and those who couldn’t do their lecture will accumulate their sadness into the total.

Hope this helps…

thanks a lot now it is clear to me.

thanks a lot @seraphwedd_17 now it is understandable.

//