Closed souvikpal2000 closed 1 year ago
The aim of the question is to get all the Tailies to the third class compartment in the minimum time.
The only reason why a Tailie comes back to the Tail is to bring back a breach suit, apart from the one they are already wearing.
I will add a more detailed explanation for more clarity and will try and rephrase it for better understanding.
There is no issue with the input and the output.
The aim of the question is to get all the Tailies to the third class compartment in the minimum time. Your approach to solving the question is one of multiple, likewise the method in the explanation is one of multiple. I have explained why some have to go back in the question itself. However the minimum time will not change.
There is no issue with the input and the output.
You have not told that some have to go back in the question. It is only mentioned that one Tailie have to go back with the Breach Suit of that member who have already reached the 3rd Compartment.
But in the calculation the member with pace of 7seconds is not mentioned. So nobody goes back for that person?
And in the Calculation it is seen that in 1st Journey 0th & 5th member started together so time taken to reach 3rd Compartment is 2 seconds (both the Tailies must walk at the slower personโs pace) 0th member return with the Breach Suit in 1 second
In 2nd Journey 3rd & 5th member started together. But why 5th??? 5th already reached 3rd Compartment but 0th member return with the Breach Suit to take another member with him.
Hi All the required information is given in the question and the explanation. Kindly go through it carefully.
Having only the person who has the least walking time go back and forth doesn't always give the minimum time. This has been determined after trying multiple approaches.
There is no issue with the input and the output.
Hi All the required information is given in the question and the explanation.
Having only the person who has the least walking time go back and forth doesn't always give the minimum time. This has been determined after trying multiple approaches.
There is no issue with the input and the output.
Okay.
Then please give line by line explanation for Sample Input 2 as it is for the Sample Input 1.
It will be helpful. Thank You.
Hi It is given in the explanation part already. I have added it for more clarity.
I hope it will help you.
Good luck ๐
Hi It is given in the explanation part already. I have added it for more clarity.
I hope it will help you.
Good luck ๐
It is not given. It is only the summation of seconds. I want the line by line Explanation same as given for Sample Input 1 (Who goes with whom & who comes back)
Hi
I have used indices to refer to the people as is mentioned in the explanation part. And the explanation is in the same format as the first sample.
Hi
I have used indices to refer to the people as is mentioned in the explanation part. And the explanation is in the same format as the first sample.
If you used indices to refer to the people, then where is the index numbered as 7 seconds.
I'm dumb ๐ฅ. I can't understand from that only. It will be helpful if you ellaborate line by line same as Sample Input 1.
It will be very very helpful. Thank You.
Hi The explanation is sufficient. I suggest you take your time and go through it carefully.
Good luck
Hi The explanation is sufficient. I suggest you take your time and go through it carefully.
Good luck
Then please explain, What happens with the guy who takes 7 seconds to travel? I can't see 7 in the summation.
Please, please explain this to me. It's really confusing.
{ 1, 4, 7, 8, 3, 2 }
The tailes are identified using indices 1 to 6. The Tail is T and the third class compartment is C:
Adding the time: 2+1+8+2+4+1+3+1+2=24 seconds = 0.4 minutes
The person who travels in 7 seconds is represented by index 3 and the person who travels in 8 seconds is represented by index 4. 3 and 4 travel together. Since 4 travels slower than 3, the time for both 3 and 4 to travel is taken as 8. This is in step 3.
Does this help?
Giving the calculation will give the answer to the puzzle. It is what you must figure out. I'll give you a hint: you are considering only the first smallest time. You need to consider more than one. I have added a more simple sample for this approach. The answer is 161 seconds which is equal to 2.683 minutes.
Originally posted by @neha2127 in https://github.com/SVCE-ACM/A-December-of-Algorithms-2022/issues/68#issuecomment-1367008366
Second Sample Input :- { 1, 4, 7, 8, 3, 2 } Calculation :- 2+1+8+2+4+1+3+1+2 = 24 seconds = 0.4 minutes
So this is the Dry run for your given Calculation.
Note : In the Question it is already told that there is only 2 Breach Suits Available so one member have to bring the Breach Suit back for remaining Tailie
& I have another doubt that in your given Calculation I can't see 7 seconds. Have that member never left the Tail Section?